2 * ext4 support added by Omegamoon
4 * -Ext4 file systems will have EXT4_FEATURE_INCOMPAT_EXTENTS, while Ext3 will not.
7 #define EXT4_SUPER_MAGIC 0xEF53
8 #define EXT4_FEATURE_COMPAT_HAS_JOURNAL 0x0004
9 #define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040
12 * Structure of the super block
14 struct ext4_super_block
{
15 /*00*/ __le32 s_inodes_count
; /* Inodes count */
16 __le32 s_blocks_count_lo
; /* Blocks count */
17 __le32 s_r_blocks_count_lo
; /* Reserved blocks count */
18 __le32 s_free_blocks_count_lo
; /* Free blocks count */
19 /*10*/ __le32 s_free_inodes_count
; /* Free inodes count */
20 __le32 s_first_data_block
; /* First Data Block */
21 __le32 s_log_block_size
; /* Block size */
22 __le32 s_obso_log_frag_size
; /* Obsoleted fragment size */
23 /*20*/ __le32 s_blocks_per_group
; /* # Blocks per group */
24 __le32 s_obso_frags_per_group
; /* Obsoleted fragments per group */
25 __le32 s_inodes_per_group
; /* # Inodes per group */
26 __le32 s_mtime
; /* Mount time */
27 /*30*/ __le32 s_wtime
; /* Write time */
28 __le16 s_mnt_count
; /* Mount count */
29 __le16 s_max_mnt_count
; /* Maximal mount count */
30 __le16 s_magic
; /* Magic signature */
31 __le16 s_state
; /* File system state */
32 __le16 s_errors
; /* Behaviour when detecting errors */
33 __le16 s_minor_rev_level
; /* minor revision level */
34 /*40*/ __le32 s_lastcheck
; /* time of last check */
35 __le32 s_checkinterval
; /* max. time between checks */
36 __le32 s_creator_os
; /* OS */
37 __le32 s_rev_level
; /* Revision level */
38 /*50*/ __le16 s_def_resuid
; /* Default uid for reserved blocks */
39 __le16 s_def_resgid
; /* Default gid for reserved blocks */
41 * These fields are for EXT4_DYNAMIC_REV superblocks only.
43 * Note: the difference between the compatible feature set and
44 * the incompatible feature set is that if there is a bit set
45 * in the incompatible feature set that the kernel doesn't
46 * know about, it should refuse to mount the filesystem.
48 * e2fsck's requirements are more strict; if it doesn't know
49 * about a feature in either the compatible or incompatible
50 * feature set, it must abort and not try to meddle with
51 * things it doesn't understand...
53 __le32 s_first_ino
; /* First non-reserved inode */
54 __le16 s_inode_size
; /* size of inode structure */
55 __le16 s_block_group_nr
; /* block group # of this superblock */
56 __le32 s_feature_compat
; /* compatible feature set */
57 /*60*/ __le32 s_feature_incompat
; /* incompatible feature set */
58 __le32 s_feature_ro_compat
; /* readonly-compatible feature set */
59 /*68*/ __u8 s_uuid
[16]; /* 128-bit uuid for volume */
60 /*78*/ char s_volume_name
[16]; /* volume name */
61 /*88*/ char s_last_mounted
[64]; /* directory where last mounted */
62 /*C8*/ __le32 s_algorithm_usage_bitmap
; /* For compression */
64 * Performance hints. Directory preallocation should only
65 * happen if the EXT4_FEATURE_COMPAT_DIR_PREALLOC flag is on.
67 __u8 s_prealloc_blocks
; /* Nr of blocks to try to preallocate*/
68 __u8 s_prealloc_dir_blocks
; /* Nr to preallocate for dirs */
69 __le16 s_reserved_gdt_blocks
; /* Per group desc for online growth */
71 * Journaling support valid if EXT4_FEATURE_COMPAT_HAS_JOURNAL set.
73 /*D0*/ __u8 s_journal_uuid
[16]; /* uuid of journal superblock */
74 /*E0*/ __le32 s_journal_inum
; /* inode number of journal file */
75 __le32 s_journal_dev
; /* device number of journal file */
76 __le32 s_last_orphan
; /* start of list of inodes to delete */
77 __le32 s_hash_seed
[4]; /* HTREE hash seed */
78 __u8 s_def_hash_version
; /* Default hash version to use */
79 __u8 s_reserved_char_pad
;
80 __le16 s_desc_size
; /* size of group descriptor */
81 /*100*/ __le32 s_default_mount_opts
;
82 __le32 s_first_meta_bg
; /* First metablock block group */
83 __le32 s_mkfs_time
; /* When the filesystem was created */
84 __le32 s_jnl_blocks
[17]; /* Backup of the journal inode */
85 /* 64bit support valid if EXT4_FEATURE_COMPAT_64BIT */
86 /*150*/ __le32 s_blocks_count_hi
; /* Blocks count */
87 __le32 s_r_blocks_count_hi
; /* Reserved blocks count */
88 __le32 s_free_blocks_count_hi
; /* Free blocks count */
89 __le16 s_min_extra_isize
; /* All inodes have at least # bytes */
90 __le16 s_want_extra_isize
; /* New inodes should reserve # bytes */
91 __le32 s_flags
; /* Miscellaneous flags */
92 __le16 s_raid_stride
; /* RAID stride */
93 __le16 s_mmp_interval
; /* # seconds to wait in MMP checking */
94 __le64 s_mmp_block
; /* Block for multi-mount protection */
95 __le32 s_raid_stripe_width
; /* blocks on all data disks (N*stride)*/
96 __u8 s_log_groups_per_flex
; /* FLEX_BG group size */
97 __u8 s_reserved_char_pad2
;
98 __le16 s_reserved_pad
;
99 __u32 s_reserved
[162]; /* Padding to the end of the block */