references:
The inode is a data structure in a Unix-style file system that describes a filesystem object such as a file or a directory. Each inode stores the attributes and disk block location(s) of the object's data.
The POSIX standard mandates filesystem behavior that is strongly influenced by traditional UNIX file systems. Regular files must have the following attributes:
- The size of the file in bytes.
- Device ID (this identifies the device containing the file).
- The User ID of the file's owner.
- The Group ID of the file.
- The file mode which determines the file type and how the file's owner, its group, and others can access the file.
- Additional system and user flags to further protect the file (limit its use and modification).
- Timestamps telling when the inode itself was last modified (ctime, inode change time), the file content last modified (mtime, modification time), and last accessed (atime, access time).
- A link count telling how many hard links point to the inode.
- Pointers to the disk blocks that store the file's contents (see inode pointer structure).
The operating system kernel's in-memory representation of this data is called struct inode
in Linux. Systems derived from BSD use the term vnode
, with the v of vnode referring to the kernel's virtual file system layer.
The VFS Inode Cache
references: http://www.science.unitn.it/~fiorella/guidelinux/tlk/node102.html
As the mounted file systems are navigated, their VFS inodes are being continually read and, in some cases, written. The Virtual File System maintains an inode cache to speed up accesses to all of the mounted file systems. Every time a VFS inode is read from the inode cache the system saves an access to a physical device.