[file system] inode

references:

  1. https://en.wikipedia.org/wiki/Inode
  2. https://en.wikipedia.org/wiki/Inode_pointer_structure

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).
inode pointer struct

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.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,921评论 0 23
  • “好羡慕你啊!”彬彬抱着闺蜜的宝宝坐在豪华的真皮沙发上说道。 “那你也赶紧结婚生一个啊!”“要不岂不是白瞎了你的魔...
    活火山宝宝阅读 144评论 0 1
  • 周一:于静 李文静 周二:陈心瑞 张影旗 周三:余淑萍 李想 周四:卜转 黄昭华 周五:乔兵 俞佑承 注:周一-周...
    唯杰不爱阅读 207评论 0 0
  • 今天刷微博看到一条话题勾起了我年少青春的回忆。 #韩庚出道12周年# 作为曾经的庚饭,他在我年少时光里留下了美好的...
    大芝芝阅读 683评论 0 1
  • 如果一个女生不喜欢你,你是感觉得到的。 一个女生对你态度敷衍,有时冷漠有时暧昧,你就应该清楚事实——她不喜欢你。 ...
    柯颈疼阅读 288评论 0 1