Skip to content

Commit e22e2a7

Browse files
author
Vladimir Kotal
committed
translate VFS slide
1 parent 7ff58af commit e22e2a7

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

files.tex

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -382,62 +382,63 @@
382382

383383
%%%%%
384384

385-
\pdfbookmark[1]{Virtual FIle System}{VFS}
385+
\pdfbookmark[1]{Virtual File System}{VFS}
386386

387387
\begin{slide}
388-
\sltitle{Virtuální systém souborů (Virtual File System)}
388+
\sltitle{Virtual File System}
389389
\begin{center}
390390
\input{img/tex/vfs.pstex_t}
391391
\end{center}
392392
\end{slide}
393393

394394
\begin{itemize}
395-
\item \emph{FFS} uvedený ve 4.2BSD byl historicky druhý unixový filesystém.
396-
Někteří dodavatelé unixových systémů ho začali preferovat vzhledem k jeho
397-
lepšímu výkonu a novým možnostem, jiný zůstávali dále u \emph{s5fs} z důvodu
398-
zpětné kompatibility. To dále prohlubovalo problém již tak nedostatečné
399-
interoperability mezi různými unixovými systémy. Některým aplikacím navíc plně
400-
nevyhovoval ani jeden z těchto filesystémů. Postupně se také objevovala
401-
potřeba pracovat s ne-unixovými filesystémy, např. \emph{FAT}. A s rostoucí
402-
popularitou počítačových sítí se zvyšovala poptávka po sdíl{}ení souborů mezi
403-
jednotlivými systémy, což mělo za následek vznik distribuovaných filesystémů
404-
-- např. \emph{NFS} (Network File System).
405-
\item vzhledem k výše popsané situaci bylo jen otázkou času, kdy dojde k
406-
fundamentálním změnám v infrastruktuře systému souborů, aby současně
407-
podporoval více typů filesystémů. Vzniklo několik různých implementací od
408-
různých výrobců, až se nakonec de facto standardem stala \emph{VFS/vnode}
409-
architektura od firmy Sun Microsystems. V dnešní době prakticky všechny
410-
unixové a u{}nix-like systémy podporují VFS, i když často se vzájemně
411-
nekompatibilními úpravami. VFS se poprvé objevilo v roce 1985 v Solarisu 2.0;
412-
brzy bylo převzato BSD -- FFS s podporou VFS se začal nazývat UFS.
413-
\item hlavní myšlenka: každému otevřenému souboru v systému přísluší struktura
414-
\texttt{file}; to by vlastně byl jeden slot v námi již známé systémové tabulce
415-
otevřených souborů. Ta ukazuje na \emph{vnode} (\emph{virtual node}). Vnode
416-
obsahuje část nezávislou na konkrétním systému souborů a část závislou, což
417-
může být například struktura \emph{inode}. Ta je specifická pro každý typ
418-
souborového systému. \emsl{Každý typ filesystému implementuje pevně danou
419-
sadu funkcí pro jednotlivé operace nad soubory}, na kterou se odkazují všechny
420-
virtuální uzly odpovídající danému typu filesystému. \emsl{Tato sada funkcí
421-
tedy definuje vnode interface.} Když tedy zavoláte například \texttt{open},
422-
jádro zavolá příslušnou implementaci v závislosti na typu filesystému (např. z
423-
modulu \emph{ext2fs}). Implementačně závislá část struktury vnode je přístupná
424-
pouze z funkcí příslušného typu filesystému; jádro do ní tedy ,,nevidí''
425-
přímo. Jak uvidíte na dalším slajdu, existuje ještě jedna sada funkcí, která
426-
se týka práce s filesystémy jako takovými. \emsl{Ta pak definuje VFS interface.}
427-
Tyto \emsl{dvě sady společně} tvoří vnode/VFS rozhraní, kterému se běžně říká
428-
jen VFS.
429-
\item (nebudu zkoušet) -- u speciálních souborů je situace složitější, v SVR4
430-
struktura \texttt{file} ukazuje na \emph{snode} (\emph{shadow-special-vnode}),
431-
který definuje operace se zařízením (pomocí souborového systému \emph{spec}) a
432-
prostřednictvím ukazatele \texttt{s\_realvp} se odkazuje na reálný vnode pro
433-
operace se speciálním souborem; ten je potřeba například pro kontrolu práv
434-
přístupu. Každému zařízení může odpovídat více speciálních souborů, a tedy více
435-
snodes a příslušných reálných vnodes. Všechny takové snodes pro jedno zařízení
436-
mají ukazatel \texttt{s\_commonvp} na jeden společný snode, to ale není na
437-
obrázku zachyceno. Při otevření speciálního souboru se hledá v hash tabulce
438-
snodes otevřených zařízení po\-lož\-ka odpovídající speciálnímu souboru (podle
439-
major a minor čísla zařízení). Když snode není nalezen, vytvoří se nový. Tento
440-
snode se pak používá při operacích se zařízením. Více viz například [Vahalia].
395+
\item The \emph{FFS} filesystem introduced in 4.2BSD was historically the second
396+
unix filesystem. Some manufacturers of unix system started to prefer its
397+
considering its better performance and new features, others remained with
398+
\emph{s5fs} from compatibility reasons. This deepened the problem with already
399+
insufficient interoperability between different unix systems. For some
400+
applications neither of these filesystems was enough. Gradually the need to work
401+
with non-unix systems started appearing, e.g. with \emph{FAT}. With growing
402+
popularity of computer networks the demand for file sharing between systems
403+
started to increase. This lead to the inception of distributed filesystems
404+
-- e.g. \emph{NFS} (Network File System).
405+
\item Given the above described situation it was just a matter of time when
406+
fundamental changes in the filesystem infrastructure will happen to support
407+
multiple filesystem types simultaneously. Several different implementations from
408+
multiple manufacturers were made; in the end the de facto standard became
409+
the \emph{VFS/vnode} architecture from Sun Microsystems. Today practically all
410+
unix u{}nix-like systems support VFS, even though with often non-compatible
411+
changes. VFS appeared for the first time in 1985 in Solaris 2.0;
412+
soon it was adopted by BSD -- FFS with VFS support started to be called UFS.
413+
\item the main idea: for each open file there is a \texttt{file} structure;
414+
it would be actually one slot in the already known system table of open files.
415+
This shows to \emph{vnode} (\emph{virtual node}). Vnode contains one part which
416+
is independent on given file system and one part dependent that could be e.g.
417+
the \emph{inode} structure. This is specific for each type of file system.
418+
\emsl{Each file system type implements concrete set of functions for individual
419+
file operations}. This set is referenced by each vnodes corresponding to given
420+
file system. \emsl{This set of functions define vnode interface.} When e.g.
421+
\texttt{open} is called, the kernel will call the corresponding implementation
422+
depending on file system type (e.g. from the \emph{ext2fs} module).
423+
Implementation dependent part of vnode structure is accessible only from
424+
functions of given filesystem; for kernel it is opaque. Next slide will shown
425+
another set of functions that works with filesystems themselves.
426+
\emsl{This set defines VFS interface.}
427+
These \emsl{two sets together} constitute the vnode/VFS interface, generally
428+
referred to as VFS.
429+
\item For special file types the situation is a bit more complicated, in SVR4
430+
the \texttt{file} structure points to \emph{snode}
431+
(\emph{shadow-special-vnode}), that defines operations with a device (using the
432+
\emph{spec} filesystem) and using the \texttt{s\_realvp} pointer it refers to
433+
real vnode for the operations with the special file; this file is necessary for
434+
example for checking file access rights. Each device can have multiple special
435+
files, hence more snodes and corresponding real vnodes. All such snodes for one
436+
device have the \texttt{s\_commonvp} pointer to one common snode, this is
437+
however not captured in the picture. When opening a special file, an item
438+
corresponding to the special file is searched in hash table of snodes of opened
439+
devices according to major and minor device number. If the snode is not found,
440+
new one is created. This snode will be then used for operations with the device.
441+
More in [Vahalia].
441442
\end{itemize}
442443

443444
%%%%%

0 commit comments

Comments
 (0)