Changeset 3712434 in mainline for uspace/lib/ext4/libext4_superblock.h
- Timestamp:
- 2011-10-05T12:48:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b9d37bb
- Parents:
- 3711e7e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_superblock.h
r3711e7e r3712434 42 42 typedef struct ext4_superblock { 43 43 uint32_t inodes_count; // Inodes count 44 uint32_t s_blocks_count_lo; // Blocks count45 uint32_t s_r_blocks_count_lo; // Reserved blocks count44 uint32_t blocks_count_lo; // Blocks count 45 uint32_t reserved_blocks_count_lo; // Reserved blocks count 46 46 uint32_t free_blocks_count_lo; // Free blocks count 47 47 uint32_t free_inodes_count; // Free inodes count 48 48 uint32_t first_data_block; // First Data Block 49 49 uint32_t log_block_size; // Block size 50 uint32_t s_obso_log_frag_size; // Obsoleted fragment size51 uint32_t s_blocks_per_group; // Number of blocks per group52 uint32_t s_obso_frags_per_group; // Obsoleted fragments per group50 uint32_t obso_log_frag_size; // Obsoleted fragment size 51 uint32_t blocks_per_group; // Number of blocks per group 52 uint32_t obso_frags_per_group; // Obsoleted fragments per group 53 53 uint32_t inodes_per_group; // Number of inodes per group 54 uint32_t s_mtime; // Mount time55 uint32_t s_wtime; // Write time54 uint32_t mount_time; // Mount time 55 uint32_t write_time; // Write time 56 56 uint16_t mount_count; // Mount count 57 57 uint16_t max_mount_count; // Maximal mount count … … 60 60 uint16_t errors; // Behaviour when detecting errors 61 61 uint16_t minor_rev_level; // Minor revision level 62 uint32_t last_check ; // Time of last check63 uint32_t check interval; // Maximum time between checks62 uint32_t last_check_time; // Time of last check 63 uint32_t check_interval; // Maximum time between checks 64 64 uint32_t creator_os; // Creator OS 65 65 uint32_t rev_level; // Revision level 66 uint16_t s_def_resuid; // Default uid for reserved blocks67 uint16_t s_def_resgid; // Default gid for reserved blocks66 uint16_t def_resuid; // Default uid for reserved blocks 67 uint16_t def_resgid; // Default gid for reserved blocks 68 68 69 69 // Fields for EXT4_DYNAMIC_REV superblocks only. 70 uint32_t s_first_ino; // First non-reserved inode70 uint32_t first_inode; // First non-reserved inode 71 71 uint16_t inode_size; // Size of inode structure 72 uint16_t s_block_group_nr; // Block group number of this superblock72 uint16_t block_group_number; // Block group number of this superblock 73 73 uint32_t features_compatible; // Compatible feature set 74 74 uint32_t features_incompatible; // Incompatible feature set 75 75 uint32_t features_read_only; // Readonly-compatible feature set 76 uint8_t s_uuid[16]; // 128-bit uuid for volume77 char s_volume_name[16]; // Volume name78 char s_last_mounted[64]; // Directory where last mounted79 uint32_t s_algorithm_usage_bitmap; // For compression76 uint8_t uuid[16]; // 128-bit uuid for volume 77 char volume_name[16]; // Volume name 78 char last_mounted[64]; // Directory where last mounted 79 uint32_t algorithm_usage_bitmap; // For compression 80 80 81 81 /* … … 90 90 * Journaling support valid if EXT4_FEATURE_COMPAT_HAS_JOURNAL set. 91 91 */ 92 uint8_t s_journal_uuid[16]; // UUID of journal superblock93 uint32_t s_journal_inum; // Inode number of journal file94 uint32_t s_journal_dev; // Device number of journal file95 uint32_t s_last_orphan; // Head of list of inodes to delete96 uint32_t s_hash_seed[4]; // HTREE hash seed97 uint8_t s_def_hash_version; // Default hash version to use98 uint8_t s_jnl_backup_type;99 uint16_t s_desc_size; // Size of group descriptor100 uint32_t s_default_mount_opts; // Default mount options101 uint32_t s_first_meta_bg; // First metablock block group102 uint32_t s_mkfs_time; // When the filesystem was created103 uint32_t s_jnl_blocks[17]; // Backup of the journal inode92 uint8_t journal_uuid[16]; // UUID of journal superblock 93 uint32_t journal_inode_number; // Inode number of journal file 94 uint32_t journal_dev; // Device number of journal file 95 uint32_t last_orphan; // Head of list of inodes to delete 96 uint32_t hash_seed[4]; // HTREE hash seed 97 uint8_t default_hash_version; // Default hash version to use 98 uint8_t journal_backup_type; 99 uint16_t desc_size; // Size of group descriptor 100 uint32_t default_mount_opts; // Default mount options 101 uint32_t first_meta_bg; // First metablock block group 102 uint32_t mkfs_time; // When the filesystem was created 103 uint32_t journal_blocks[17]; // Backup of the journal inode 104 104 105 105 /* 64bit support valid if EXT4_FEATURE_COMPAT_64BIT */ 106 uint32_t s_blocks_count_hi; // Blocks count 107 uint32_t s_r_blocks_count_hi; // Reserved blocks count 108 uint32_t s_free_blocks_count_hi; // Free blocks count 109 uint16_t s_min_extra_isize; // All inodes have at least # bytes 110 uint16_t s_want_extra_isize; // New inodes should reserve # bytes 111 uint32_t s_flags; // Miscellaneous flags 112 uint16_t s_raid_stride; // RAID stride 113 uint16_t s_mmp_interval; // # seconds to wait in MMP checking 114 uint64_t s_mmp_block; // Block for multi-mount protection 115 uint32_t s_raid_stripe_width; // blocks on all data disks (N*stride) 116 uint8_t s_log_groups_per_flex; // FLEX_BG group size 117 uint8_t s_reserved_char_pad; 118 uint16_t s_reserved_pad; 119 uint64_t s_kbytes_written; // Number of lifetime kilobytes written 120 uint32_t s_snapshot_inum; // Inode number of active snapshot 121 uint32_t s_snapshot_id; // Sequential ID of active snapshot 122 uint64_t s_snapshot_r_blocks_count; /* reserved blocks for active snapshot's future use */ 123 uint32_t s_snapshot_list; // inode number of the head of the on-disk snapshot list 124 uint32_t s_error_count; // number of fs errors 125 uint32_t s_first_error_time; // First time an error happened 126 uint32_t s_first_error_ino; // Inode involved in first error 127 uint64_t s_first_error_block; // block involved of first error 128 uint8_t s_first_error_func[32]; // Function where the error happened 129 uint32_t s_first_error_line; // Line number where error happened 130 uint32_t s_last_error_time; // Most recent time of an error 131 uint32_t s_last_error_ino; // Inode involved in last error 132 uint32_t s_last_error_line; // Line number where error happened 133 uint64_t s_last_error_block; /* block involved of last error */ 134 uint8_t s_last_error_func[32]; /* function where the error happened */ 135 uint8_t s_mount_opts[64]; 136 uint32_t s_reserved[112]; // Padding to the end of the block 137 106 uint32_t blocks_count_hi; // Blocks count 107 uint32_t reserved_blocks_count_hi; // Reserved blocks count 108 uint32_t free_blocks_count_hi; // Free blocks count 109 uint16_t min_extra_isize; // All inodes have at least # bytes 110 uint16_t want_extra_isize; // New inodes should reserve # bytes 111 uint32_t lags; // Miscellaneous flags 112 uint16_t raid_stride; // RAID stride 113 uint16_t mmp_interval; // # seconds to wait in MMP checking 114 uint64_t mmp_block; // Block for multi-mount protection 115 uint32_t raid_stripe_width; // blocks on all data disks (N*stride) 116 uint8_t log_groups_per_flex; // FLEX_BG group size 117 uint8_t reserved_char_pad; 118 uint16_t reserved_pad; 119 uint64_t kbytes_written; // Number of lifetime kilobytes written 120 uint32_t snapshot_inum; // Inode number of active snapshot 121 uint32_t snapshot_id; // Sequential ID of active snapshot 122 uint64_t snapshot_r_blocks_count; /* reserved blocks for active snapshot's future use */ 123 uint32_t snapshot_list; // inode number of the head of the on-disk snapshot list 124 uint32_t error_count; // number of fs errors 125 uint32_t first_error_time; // First time an error happened 126 uint32_t first_error_ino; // Inode involved in first error 127 uint64_t first_error_block; // block involved of first error 128 uint8_t first_error_func[32]; // Function where the error happened 129 uint32_t first_error_line; // Line number where error happened 130 uint32_t last_error_time; // Most recent time of an error 131 uint32_t last_error_ino; // Inode involved in last error 132 uint32_t last_error_line; // Line number where error happened 133 uint64_t last_error_block; // Block involved of last error 134 uint8_t last_error_func[32]; // Function where the error happened 135 uint8_t mount_opts[64]; 136 uint32_t padding[112]; // Padding to the end of the block 138 137 } __attribute__((packed)) ext4_superblock_t; 139 138 … … 142 141 #define EXT4_SUPERBLOCK_OFFSET 1024 143 142 143 extern uint32_t ext4_superblock_get_inodes_count(ext4_superblock_t *); 144 extern uint64_t ext4_superblock_get_blocks_count(ext4_superblock_t *); 145 extern uint64_t ext4_superblock_get_reserved_blocks_count(ext4_superblock_t *); 146 extern uint64_t ext4_superblock_get_free_blocks_count(ext4_superblock_t *); 147 extern uint32_t ext4_superblock_get_free_inodes_count(ext4_superblock_t *); 148 extern uint32_t ext4_superblock_get_first_data_block(ext4_superblock_t *); 149 extern uint32_t ext4_superblock_get_log_block_size(ext4_superblock_t *); 150 extern uint32_t ext4_superblock_get_block_size(ext4_superblock_t *); 151 extern uint32_t ext4_superblock_get_blocks_per_group(ext4_superblock_t *); 152 extern uint32_t ext4_superblock_get_inodes_per_group(ext4_superblock_t *); 153 extern uint32_t ext4_superblock_get_mount_time(ext4_superblock_t *); 154 extern uint32_t ext4_superblock_get_write_time(ext4_superblock_t *); 155 extern uint16_t ext4_superblock_get_mount_count(ext4_superblock_t *); 156 extern uint16_t ext4_superblock_get_max_mount_count(ext4_superblock_t *); 144 157 extern uint16_t ext4_superblock_get_magic(ext4_superblock_t *); 145 extern uint32_t ext4_superblock_get_first_block(ext4_superblock_t *); 146 extern uint32_t ext4_superblock_get_block_size_log2(ext4_superblock_t *); 147 extern uint32_t ext4_superblock_get_block_size(ext4_superblock_t *); 148 extern uint32_t ext4_superblock_get_rev_level(ext4_superblock_t *); 149 extern uint16_t ext4_superblock_get_inode_size(ext4_superblock_t *); 150 extern uint32_t ext4_superblock_get_inodes_per_group(ext4_superblock_t *); 158 extern uint16_t ext4_superblock_get_state(ext4_superblock_t *); 159 extern uint16_t ext4_superblock_get_errors(ext4_superblock_t *); 160 extern uint16_t ext4_superblock_get_minor_rev_level(ext4_superblock_t *); 161 extern uint32_t ext4_superblock_get_last_check_time(ext4_superblock_t *); 162 extern uint32_t ext4_superblock_get_check_interval(ext4_superblock_t *); 163 extern uint32_t ext4_superblock_get_creator_os(ext4_superblock_t *); 164 extern uint32_t ext4_superblock_get_rev_level(ext4_superblock_t *); 165 166 /* 167 uint16_t s_def_resuid; // Default uid for reserved blocks 168 uint16_t s_def_resgid; // Default gid for reserved blocks 169 */ 170 171 extern uint32_t ext4_superblock_get_first_inode(ext4_superblock_t *); 172 extern uint16_t ext4_superblock_get_inode_size(ext4_superblock_t *); 173 extern uint16_t ext4_superblock_get_block_group_number(ext4_superblock_t *); 151 174 extern uint32_t ext4_superblock_get_features_compatible(ext4_superblock_t *); 152 175 extern uint32_t ext4_superblock_get_features_incompatible(ext4_superblock_t *); 153 176 extern uint32_t ext4_superblock_get_features_read_only(ext4_superblock_t *); 154 177 178 /* 179 uint8_t s_uuid[16]; // 128-bit uuid for volume 180 char volume_name[16]; // Volume name 181 char last_mounted[64]; // Directory where last mounted 182 uint32_t s_algorithm_usage_bitmap; // For compression 183 uint8_t s_prealloc_blocks; // Number of blocks to try to preallocate 184 uint8_t s_prealloc_dir_blocks; // Number to preallocate for dirs 185 uint16_t s_reserved_gdt_blocks; // Per group desc for online growth 186 uint8_t s_journal_uuid[16]; // UUID of journal superblock 187 uint32_t s_journal_inum; // Inode number of journal file 188 uint32_t s_journal_dev; // Device number of journal file 189 uint32_t s_last_orphan; // Head of list of inodes to delete 190 uint32_t s_hash_seed[4]; // HTREE hash seed 191 uint8_t s_def_hash_version; // Default hash version to use 192 uint8_t s_jnl_backup_type; 193 uint16_t s_desc_size; // Size of group descriptor 194 uint32_t s_default_mount_opts; // Default mount options 195 uint32_t s_first_meta_bg; // First metablock block group 196 uint32_t s_mkfs_time; // When the filesystem was created 197 uint32_t s_jnl_blocks[17]; // Backup of the journal inode 198 uint16_t s_min_extra_isize; // All inodes have at least # bytes 199 uint16_t s_want_extra_isize; // New inodes should reserve # bytes 200 uint32_t s_flags; // Miscellaneous flags 201 uint16_t s_raid_stride; // RAID stride 202 uint16_t s_mmp_interval; // # seconds to wait in MMP checking 203 uint64_t s_mmp_block; // Block for multi-mount protection 204 uint32_t s_raid_stripe_width; // blocks on all data disks (N*stride) 205 uint8_t s_log_groups_per_flex; // FLEX_BG group size 206 uint8_t s_reserved_char_pad; 207 uint16_t s_reserved_pad; 208 uint64_t s_kbytes_written; // Number of lifetime kilobytes written 209 uint32_t s_snapshot_inum; // Inode number of active snapshot 210 uint32_t s_snapshot_id; // Sequential ID of active snapshot 211 uint64_t s_snapshot_r_blocks_count; // reserved blocks for active snapshot's future use 212 uint32_t s_snapshot_list; // inode number of the head of the on-disk snapshot list 213 uint32_t s_error_count; // number of fs errors 214 uint32_t s_first_error_time; // First time an error happened 215 uint32_t s_first_error_ino; // Inode involved in first error 216 uint64_t s_first_error_block; // block involved of first error 217 uint8_t s_first_error_func[32]; // Function where the error happened 218 uint32_t s_first_error_line; // Line number where error happened 219 uint32_t s_last_error_time; // Most recent time of an error 220 uint32_t s_last_error_ino; // Inode involved in last error 221 uint32_t s_last_error_line; // Line number where error happened 222 uint64_t s_last_error_block; // block involved of last error 223 uint8_t s_last_error_func[32]; // function where the error happened 224 uint8_t s_mount_opts[64]; 225 */ 226 227 /* More complex superblock functions */ 155 228 extern int ext4_superblock_read_direct(service_id_t, ext4_superblock_t **); 156 229 extern int ext4_superblock_check_sanity(ext4_superblock_t *);
Note:
See TracChangeset
for help on using the changeset viewer.