VFS travelling (1)

Would like to share some knowledge about VFS on Linux 2.6.37.1.
 
Before start, let's get to know some terms in LINUX file system world. They are:
1. Super Block: we can think it as Partition;
2. Inode: like a directory structure;
3. Dentry: a file or folder.
 
And then, i'd like to introduce some key data structures in VFS. They are:
 
1. file_system_type
Certain fields are listed:
• name: the actual file system name, like "rootfs", "ext3", etc;
• next: points to the next file_system_type node in the list;
• fs_supers: links to the list of super blocks of this file system;


2. super_block
Certain fields are listed:
• s_type: points to its file_system_type;
• s_instances: links to fs_supers list of file_system_type;
• s_root: links to the list of dentrys, which will be introduced soon;


3. dentry
Certain fields are listed:
• d_name: a qstr structure which includes hash code and name string of the dentry. e.g. "/home";
• d_sb: points to the super block of this dentry;
• d_parent: points to the parents of this dentry;
• d_inodes: points to the inode, which will be introduced soon;
• d_mounted: to indicate if there's any block device be mounted to this dentry; this is a very important field which will be introduced more later on;
• d_hash: links to the hash list for quick searching a child under it's parent folder;


4. inode
Certain fields are listed:
• i_sb: points to the super block;

 

(To be continue)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值