Representation of file systems
2. Finding a file
-
Once a filesystem is mounted, it is possible to access files
on that filesystem.
-
Two main steps here:
-
looking up the name to find what
inode it points to
-
then accessing the inode.
-
Every component which is looked up, whether it is a file
or a directory, returns an inode number which uniquely identifies
it, and by which its contents are accessed.6
-
If the file turns out to be a symbolic link to another file,
then the VFS starts over with the new name which is retrieved from the
symbolic link. In order to prevent infinite recursion, there's a limit
on the depth of symlinks; the kernel will only follow so many symlinks
in a row before giving up.
-
When the VFS and the filesystem together have resolved a
name into an inode number, then the inode can be accessed.
[back][next]