superblock,file,dentry,inode的区别
来源:互联网 发布:京东广告部算法工程师 编辑:程序博客网 时间:2024/06/04 23:35
保存一个挂在的文件系统的相关信息(Stores information concerning a mounted filesystem. For disk-based filesystems, this object usually corresponds to a filesystem control block stored on disk.)
2、inode
保存一个文件的通用信息,每个inode有一个inode number,在文件系统中,一个inode number能够唯一地标识一个文件(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、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、dentry
保存一个目录的链接信息(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.)
eg:有三个不同的进程打开同一个文件,其中有两个进程使用了相同的硬链接。三个进程拥有各自的file object,而只有两个dentry用来指示文件的硬链接。两个dentry都指向同一个inode。
1)进程每打开一个文件,就会有一个file结构与之对应。同一个进程可以多次打开同一个文件而得到多个不同的file结构,file结构描述被打开文件的属性,如文件的当前偏移量等信息。
2)两个不同的file结构可以对应同一个dentry结构。进程多次打开同一个文件时,对应的只有一个dentry结构。Dentry结构存储目录项和对应文件(inode)的信息。
3)在存储介质中,每个文件对应唯一的inode结点,但是每个文件又可以有多个文件名。即可以通过不同的文件名访问同一个文件。这里多个文件名对应一个文件的关系在数据结构中表示就是dentry和inode的关系。
4)Inode中不存储文件的名字,它只存储节点号;而dentry则保存有名字和与其对应的节点号,所以就可以通过不同的dentry访问同一个inode。
5)不同的dentry则是同个文件链接(ln命令)来实现的
上一篇:va_start va_end 的使用和原理
下一篇:对linux字符设备的理解(整体架构)
- linux 常见服务端口
- 【ROOTFS搭建】busybox的httpd...
- xmanager 2.0 for linux配置
- 什么是shell
- linux socket的bug??
- linux dhcp peizhi roc
- 关于Unix文件的软链接
- 求教这个命令什么意思,我是新...
- sed -e "/grep/d" 是什么意思...
- 谁能够帮我解决LINUX 2.6 10...
- superblock,file,dentry,inode的区别
- superblock,file,dentry,inode的区别
- superblock,file,dentry,inode的区别
- vfs的superblock、inode、dentry、file之间的关系
- Linux 文件系统的 Superblock, Inode, Dentry 和 File
- Linux 文件系统的 Superblock, Inode, Dentry 和 File
- superblock,vfsmount,dentry,inode
- 简单介绍Linux文件系统中superblock、inode、dentry、file
- superblock,dentry,inode浅析(译转)
- dentry 与inode的概念
- 【文件管理】file,dentry,inode,super_block
- struct inode struct dentry struct file
- inode,block,superblock的关系
- LINUX-VFS的supper bolck、inode、dentry和file关系简述
- LINUX-VFS的supper bolck、inode、dentry和file关系简述
- LINUX-VFS的supper bolck、inode、dentry和file关系简述
- dentry与inode节点之间的关系
- linux文件系统与模型【笔记】 surper block/inode/dentry/file
- Makefile
- linux字符cdev和Inode的关系
- HAL层开发框架介绍
- class.c重要函数浅析
- va_start va_end 的使用和原理
- superblock,file,dentry,inode的区别
- 对linux字符设备的理解(整体架构)
- printk及控制台的日志级别
- 菜鸟编译Linux内核
- Linux/stat.h 读写权限
- 三星S3C2440 Datasheet LCD Controller 章节翻译(2)
- proc函数
- 内联函数
- 关于might_sleep的一点说明