1. 程式人生 > >dentry與inode節點之間的關係

dentry與inode節點之間的關係

struct dentry {
atomic_t d_count; 目錄項物件使用計數器unsigned int d_flags; 目錄項標誌struct inode * d_inode; 與檔名關聯的索引節點struct dentry * d_parent; 父目錄的目錄項物件struct list_head d_hash; 散列表表項的指標struct list_head d_lru; 未使用連結串列的指標struct list_head d_child; 父目錄中目錄項物件的連結串列的指標struct list_head d_subdirs;對目錄而言,表示子目錄目錄項物件的連結串列struct list_head d_alias;
相關索引節點(別名)的連結串列int d_mounted; 對於安裝點而言,表示被安裝檔案系統根項struct qstr d_name; 檔名unsigned long d_time; /* used by d_revalidate */
struct dentry_operations *d_op; 目錄項方法struct super_block * d_sb; 檔案的超級塊物件vunsigned long d_vfs_flags;
void * d_fsdata;與檔案系統相關的資料unsigned char d_iname [DNAME_INLINE_LEN]; 存放短檔名};
  二、dentry
inode
inode(可理解為ext2 inode)對應於物理磁碟上的具體物件,dentry是一個記憶體實體,其中的d_inode成員指向對應的inode。也就是說,一個inode可以在執行的時候連結多個dentry,而d_count記錄了這個連結的數量。