Linux 核心--16.Linux数据结构(6) int count; unsigned short umask; struct inode * root, * pwd; };
gendisk 包含关于某个硬盘的信息。用于磁盘初始化与分区检查时。
struct hd_struct { long start_sect; long nr_sects; };
struct gendisk { int major; /* major number of driver */ const char *major_name; /* name of major driver */ int minor_shift; /* number of times minor is shifted to get real minor */ int max_p; /* maximum partitions per device */ int max_nr; /* maximum number of real devices */
void (*init)(struct gendisk *); /* Initialization called before we do our thing */ struct hd_struct *part; /* partition table */ int *sizes; /* device size in blocks, copied to blk_size[] */ int nr_real; /* number of real devices */
void *real_devices; /* internal use */ struct gendisk *next; };
inode 此VFS inode结构描叙磁盘上一个文件或目录的信息。
struct inode { kdev_t i_dev; unsigned long i_ino; umode_t i_mode; nlink_t i_nlink; uid_t i_uid; gid_t i_gid; kdev_t i_rdev; off_t i_size; time_t i_atime; time_t i_mtime; time_t i_ctime; unsigned long i_blksize; unsigned long i_blocks; unsigned long i_version; unsigned long i_nrpages; struct semaphore i_sem; struct inode_operations *i_op; struct super_block *i_sb;