linux vfs 解析 之 superblock

原文:http://blog.sina.com.cn/s/blog_5219094a01009a4c.html


super block


相關的數據結構爲:

struct super_block {
 struct list_head s_list;  
 dev_t   s_dev;  
 unsigned long  s_blocksize;
 unsigned long  s_old_blocksize;
 unsigned char  s_blocksize_bits;
 unsigned char  s_dirt;
 unsigned long long s_maxbytes; 
 struct file_system_type *s_type;
 struct super_operations *s_op;
 struct dquot_operations *dq_op;
  struct quotactl_ops *s_qcop;
 struct export_operations *s_export_op;
 unsigned long  s_flags;
 unsigned long  s_magic;
 struct dentry  *s_root;
 struct rw_semaphore s_umount;
 struct semaphore s_lock;
 int   s_count;
 int   s_syncing;
 int   s_need_sync_fs;
 atomic_t  s_active;
 void                    *s_security;
 struct xattr_handler **s_xattr;

 struct list_head s_inodes; 
 struct list_head s_dirty; 
 struct list_head s_io;  
 struct hlist_head s_anon;  
 struct list_head s_files;

 struct block_device *s_bdev;
 struct list_head s_instances;
 struct quota_info s_dquot; 

 int   s_frozen;
 wait_queue_head_t s_wait_unfrozen;

 char s_id[32];    

 void    *s_fs_info; 

 
 struct semaphore s_vfs_rename_sem; 

 
 u32     s_time_gran;
};

 


super_block存在於兩個鏈表中,一個是系統所有super_block的鏈表, 一個是對於特定的文件系統的super_block鏈表.

                                                                            
所有的super_block都存在於 super-blocks 鏈表中:
                                                                            
                                                                            
            /------------\               

發佈了0 篇原創文章 · 獲贊 6 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章