Chinaunix首页 | 论坛 | 博客
  • 博客访问: 315867
  • 博文数量: 72
  • 博客积分: 2580
  • 博客等级: 少校
  • 技术积分: 675
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-07 17:36
文章分类

全部博文(72)

文章存档

2012年(7)

2011年(17)

2010年(46)

2009年(2)

分类: LINUX

2010-10-08 15:37:49

The common file model consists of the following object types:
<1>The superblock object
Stores information concerning a mounted filesystem. For disk-based filesystems, this object usually corresponds to a filesystem control block stored on disk.
<2>The inode object
Stores general information about a specific file. For disk-based filesystems, this object usually corresponds to a file control block stored on disk. Each inode object is associated with an inode number, which uniquely identifies the file within the filesystem.
<3>The file object
Stores information about the interaction between an open file and a process. This information exists only in kernel memory during the period when a process has the file open.
<4>The dentry object
Stores information about the linking of a directory entry (that is, a particular name of the file) with the corresponding file. Each disk-based filesystem stores this information in its own particular way on disk.
Figure 12-2 illustrates with a simple example how processes interact with files. Three different processes have opened the same file, two of them using the same hard link. In this case, each of the three processes uses its own file object, while only two dentry objects are requiredone for each hard link. Both dentry objects refer to the same inode object, which identifies the superblock object and, together with the latter, the common disk file.

Figure 12-2. Interaction between processes and VFS objects

   Note: 1. 从上图可以看出 struct file 是一个dentry,对file的访问最后都是对dentry的访问。
阅读(3088) | 评论(1) | 转发(0) |
0

上一篇:diff & patch制作

下一篇:inode之i_writecount

给主人留下些什么吧!~~

chinaunix网友2010-10-10 15:37:24

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com