📄 super.h
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/fs/super.h
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20700 /* Super block table. The root file system and every mounted file system
20701 * has an entry here. The entry holds information about the sizes of the bit
20702 * maps and inodes. The s_ninodes field gives the number of inodes available
20703 * for files and directories, including the root directory. Inode 0 is
20704 * on the disk, but not used. Thus s_ninodes = 4 means that 5 bits will be
20705 * used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
20706 * for files and directories. The disk layout is:
20707 *
20708 * Item # blocks
20709 * boot block 1
20710 * super block 1
20711 * inode map s_imap_blocks
20712 * zone map s_zmap_blocks
20713 * inodes (s_ninodes + 'inodes per block' - 1)/'inodes per block'
20714 * unused whatever is needed to fill out the current zone
20715 * data zones (s_zones - s_firstdatazone) << s_log_zone_size
20716 *
20717 * A super_block slot is free if s_dev == NO_DEV.
20718 */
20719
20720
20721 EXTERN struct super_block {
20722 ino_t s_ninodes; /* # usable inodes on the minor device */
20723 zone1_t s_nzones; /* total device size, including bit maps etc */
20724 short s_imap_blocks; /* # of blocks used by inode bit map */
20725 short s_zmap_blocks; /* # of blocks used by zone bit map */
20726 zone1_t s_firstdatazone; /* number of first data zone */
20727 short s_log_zone_size; /* log2 of blocks/zone */
20728 off_t s_max_size; /* maximum file size on this device */
20729 short s_magic; /* magic number to recognize super-blocks */
20730 short s_pad; /* try to avoid compiler-dependent padding */
20731 zone_t s_zones; /* number of zones (replaces s_nzones in V2) */
20732
20733 /* The following items are only used when the super_block is in memory. */
20734 struct inode *s_isup; /* inode for root dir of mounted file sys */
20735 struct inode *s_imount; /* inode mounted on */
20736 unsigned s_inodes_per_block; /* precalculated from magic number */
20737 dev_t s_dev; /* whose super block is this? */
20738 int s_rd_only; /* set to 1 iff file sys mounted read only */
20739 int s_native; /* set to 1 iff not byte swapped file system */
20740 int s_version; /* file system version, zero means bad magic */
20741 int s_ndzones; /* # direct zones in an inode */
20742 int s_nindirs; /* # indirect zones per indirect block */
20743 bit_t s_isearch; /* inodes below this bit number are in use */
20744 bit_t s_zsearch; /* all zones below this bit number are in use*/
20745 } super_block[NR_SUPERS];
20746
20747 #define NIL_SUPER (struct super_block *) 0
20748 #define IMAP 0 /* operating on the inode bit map */
20749 #define ZMAP 1 /* operating on the zone bit map */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -