linux 之inode

先看看Inode的结构图

再来了解一下文件系统如何存取文件的

1、根据文件名,通过Directory里的对应关系,找到文件对应的Inode number
2、再根据Inode number读取到文件的Inode table
3、再根据Inode table中的Pointer读取到相应的Blocks

这里有一个重要的内容,就是Directory,他不是我们通常说的目录,而是一个列表,记录了一个文件/目录名称对应的Inode number。如下

Directory:
A directory is a mapping between the human name for the file and the computer's inode number.
所以说,这个Directory不是文件,我们可以看作是文件系统中的一个属性,只是用来关键文件名与Inode number。这个一定要理解好,否则后面关于硬链接的内容,就不容易理解了。

转载http://www.cnblogs.com/hnrainll/archive/2011/06/18/2084210.html

猜你喜欢

转载自pb-water.iteye.com/blog/2144877