歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> Inode 結構:基本資料

Inode 結構:基本資料

日期:2017/2/27 9:36:55   编辑:更多Linux

inode的基本資料蠻多,在此我很簡略的跟各位介紹一下     unsigned long i_ino;     每一個inode都有一個序號,經由super block結構和其序號,我們可以很輕易的找到這個inode。     unsigned int i_count;     在Kernel裡,很多的結構都會記錄其reference count,以確保如果某個結構正在使用,它不會被不小心釋放掉,i_count就是其reference count。     kdev_t i_dev; /* inode所在的device代碼 */   umode_t i_mode; /* inode的權限 */   nlink_t i_nlink; /* hard link的個數 */   uid_t i_uid; /* inode擁有者的id */   gid_t i_gid; /* inode所屬的群組id */   kdev_t i_rdev; /* 如果inode代表的是device的話,   那此字段將記錄device的代碼 */   off_t i_size; /* inode所代表的檔案大小 */   time_t i_atime; /* inode最近一次的存取時間 */   time_t i_mtime; /* inode最近一次的修改時間 */   time_t i_ctime; /* inode的產生時間 */   unsigned long i_blksize; /* inode在做IO時的區塊大小 */   unsigned long i_blocks; /* inode所使用的block數,一個block為512 byte*/   unsigned long i_version; /* 版本號碼 */   unsigned long i_nrpages; /* inode所使用的page個數 */   strUCt page *i_pages;   /* inode使用的page會被放在串行裡,這個字段記錄著此串行的開頭 */   struct super_block *i_sb; /* inode所屬檔案系統的super block */   unsigned long i_state;   /* inode目前的狀態,可以是I_DIRTY,I_LOCK和 I_FREEING的OR組合 */   unsigned int i_flags; /* 記錄此inode的參數 */   unsigned char i_pipe; /* 用來記錄此inode是否為pipe */   unsigned char i_sock; /* 用來記錄此inode是否為socket */   unsigned int i_attr_flags; /* 用來記錄此inode的屬性參數 */   struct file_lock *i_flock; /* 用來做file lock */   




Copyright © Linux教程網 All Rights Reserved