Ext2 ÎļþϵͳµÄÓ²Å̲¼¾Ö
__u32 s_checkinterval; /* max. time between checks */ __u32 s_creator_os; /* ¿ÉÒÔºöÂÔ */ __u32 s_rev_level; /* Revision level */ /*50*/ __u16 s_def_resuid; /* Default uid for reserved blocks */ __u16 s_def_resgid; /* Default gid for reserved blocks */ __u32 s_first_ino; /* First non-reserved inode */ __u16 s_inode_size; /* size of inode structure */ __u16 s_block_group_nr; /* block group # of this superblock */ __u32 s_feature_compat; /* compatible feature set */ /*60*/ __u32 s_feature_incompat; /* incompatible feature set */ __u32 s_feature_ro_compat; /* readonly-compatible feature set */ /*68*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */ /*78*/ char s_volume_name[16]; /* volume name */ /*88*/ char s_last_mounted[64]; /* directory where last mounted */ /*C8*/ __u32 s_algorithm_usage_bitmap; /* ¿ÉÒÔºöÂÔ */ __u8 s_prealloc_blocks; /* ¿ÉÒÔºöÂÔ */ __u8 s_prealloc_dir_blocks; /* ¿ÉÒÔºöÂÔ */ __u16 s_padding1; /* ¿ÉÒÔºöÂÔ */ /*D0*/ __u8 s_journal_uuid[16]; /* uuid of journal superblock */ /*E0*/ __u32 s_journal_inum; /* ÈÕÖ¾ÎļþµÄ inode ºÅÊý */ __u32 s_journal_dev; /* ÈÕÖ¾ÎļþµÄÉ豸ºÅ */ __u32 s_last_orphan; /* start of list of inodes to delete */ /*EC*/ __u32 s_reserved[197]; /* ¿ÉÒÔºöÂÔ */ };
ÎÒÃÇ¿ÉÒÔ¿´µ½£¬super block Ò»¹²ÓÐ 1024 bytes ÄÇô´ó¡£ÔÚ super block ÖУ¬ÎÒÃǵÚÒ»¸öÒª¹ØÐĵÄ×Ö¶ÎÊÇ magic Ç©Ãû£¬¶ÔÓÚ ext2 ºÍ ext3 ÎļþϵͳÀ´Ëµ£¬Õâ¸ö×ֶεÄÖµÓ¦¸ÃÕýºÃµÈÓÚ 0xEF53¡£Èç¹û²»µÈµÄ»°£¬ÄÇôÕâ¸öÓ²ÅÌ·ÖÇøÉϿ϶¨²»ÊÇÒ»¸öÕý³£µÄ ext2 »ò ext3 Îļþϵͳ¡£´ÓÕâÀÎÒÃÇÒ²¿ÉÒÔ¹À¼Æµ½£¬ext2 ºÍ ext3 µÄ¼æÈÝÐÔÒ»¶¨ÊǺÜÇ¿µÄ£¬²»È»µÄ»°£¬Linux Äں˵Ŀª·¢ÕßÓ¦¸Ã»áΪ ext3 ÎļþϵͳÁíÑ¡Ò»¸ö magic Ç©Ãû²Å¶Ô¡£
ÔÚ super block ÖÐÁíÒ»¸öÖØÒªµÄ×Ö¶ÎÊÇ s_log_block_size¡£´ÓÕâ¸ö×ֶΣ¬ÎÒÃÇ¿ÉÒԵóöÕæÕýµÄ block µÄ´óС¡£ÎÒÃÇ°ÑÕæÕý block µÄ´óС¼Ç×÷ B£¬B = 1 << (s_log_block_size + 10)£¬µ¥Î»ÊÇ bytes¡£¾ÙÀýÀ´Ëµ£¬Èç¹ûÕâ¸ö×Ö¶ÎÊÇ 0£¬ÄÇô block µÄ´óС¾ÍÊÇ 1024 bytes£¬ÕâÕýºÃ¾ÍÊÇ×îСµÄ block ´óС£»Èç¹ûÕâ¸ö×Ö¶ÎÊÇ 2£¬ÄÇô block ´óС¾ÍÊÇ 4096 bytes¡£´ÓÕâÀïÎÒÃǾ͵õ½ÁË block µÄ´óСÕâÒ»·Ç³£ÖØÒªµÄÊý¾Ý¡£ ±¾ÐÂÎŹ² 6Ò³,µ±Ç°ÔÚµÚ 3Ò³ 1 2 3 4 5 6 |