Changeset 9875711 in mainline for uspace/lib/ext4/libext4_superblock.h


Ignore:
Timestamp:
2011-09-29T17:17:39Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c501f8
Parents:
eb91db7
Message:

Superblock and inode structures definition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_superblock.h

    reb91db7 r9875711  
    2929/** @addtogroup libext4
    3030 * @{
    31  */ 
     31 */
    3232
    3333#ifndef LIBEXT4_LIBEXT4_SUPERBLOCK_H_
    3434#define LIBEXT4_LIBEXT4_SUPERBLOCK_H_
     35
     36#include <sys/types.h>
     37
     38/*
     39 * Structure of the super block
     40 */
     41typedef struct ext4_superblock {
     42        uint32_t s_inodes_count; // Inodes count
     43        uint32_t s_blocks_count_lo; // Blocks count
     44        uint32_t s_r_blocks_count_lo; // Reserved blocks count
     45        uint32_t s_free_blocks_count_lo; // Free blocks count
     46        uint32_t s_free_inodes_count; // Free inodes count
     47        uint32_t s_first_data_block; // First Data Block
     48        uint32_t s_log_block_size; // Block size
     49        uint32_t s_obso_log_frag_size; // Obsoleted fragment size
     50        uint32_t s_blocks_per_group; // Number of blocks per group
     51        uint32_t s_obso_frags_per_group; // Obsoleted fragments per group
     52        uint32_t s_inodes_per_group; // Number of inodes per group
     53        uint32_t s_mtime; // Mount time
     54        uint32_t s_wtime; // Write time
     55        uint16_t s_mnt_count; // Mount count
     56        uint16_t s_max_mnt_count; // Maximal mount count
     57        uint16_t s_magic; // Magic signature
     58        uint16_t s_state; // File system state
     59        uint16_t s_errors; // Behaviour when detecting errors
     60        uint16_t s_minor_rev_level; // Minor revision level
     61        uint32_t s_lastcheck; // Time of last check
     62        uint32_t s_checkinterval; // Maximum time between checks
     63        uint32_t s_creator_os; // Creator OS
     64        uint32_t s_rev_level; // Revision level
     65        uint16_t s_def_resuid; // Default uid for reserved blocks
     66        uint16_t s_def_resgid; // Default gid for reserved blocks
     67
     68        // Fields for EXT4_DYNAMIC_REV superblocks only.
     69        uint32_t s_first_ino; // First non-reserved inode
     70        uint16_t s_inode_size; // Size of inode structure
     71        uint16_t s_block_group_nr; // Block group number of this superblock
     72        uint32_t s_feature_compat; // Compatible feature set
     73        uint32_t s_feature_incompat; // Incompatible feature set
     74        uint32_t s_feature_ro_compat; // Readonly-compatible feature set
     75        uint8_t s_uuid[16]; // 128-bit uuid for volume
     76        char s_volume_name[16]; // Volume name
     77        char s_last_mounted[64]; // Directory where last mounted
     78        uint32_t s_algorithm_usage_bitmap; // For compression
     79
     80        /*
     81         * Performance hints. Directory preallocation should only
     82         * happen if the EXT4_FEATURE_COMPAT_DIR_PREALLOC flag is on.
     83         */
     84        uint8_t s_prealloc_blocks; // Number of blocks to try to preallocate
     85        uint8_t s_prealloc_dir_blocks; // Number to preallocate for dirs
     86        uint16_t s_reserved_gdt_blocks; // Per group desc for online growth
     87
     88        /*
     89         * Journaling support valid if EXT4_FEATURE_COMPAT_HAS_JOURNAL set.
     90         */
     91        uint8_t s_journal_uuid[16]; // UUID of journal superblock
     92        uint32_t s_journal_inum; // Inode number of journal file
     93        uint32_t s_journal_dev; // Device number of journal file
     94        uint32_t s_last_orphan; // Head of list of inodes to delete
     95        uint32_t s_hash_seed[4]; // HTREE hash seed
     96        uint8_t s_def_hash_version; // Default hash version to use
     97        uint8_t s_jnl_backup_type;
     98        uint16_t s_desc_size; // Size of group descriptor
     99        uint32_t s_default_mount_opts; // Default mount options
     100        uint32_t s_first_meta_bg; // First metablock block group
     101        uint32_t s_mkfs_time; // When the filesystem was created
     102        uint32_t s_jnl_blocks[17]; // Backup of the journal inode
     103
     104        /* 64bit support valid if EXT4_FEATURE_COMPAT_64BIT */
     105        uint32_t s_blocks_count_hi; // Blocks count
     106        uint32_t s_r_blocks_count_hi; // Reserved blocks count
     107        uint32_t s_free_blocks_count_hi; // Free blocks count
     108        uint16_t s_min_extra_isize; // All inodes have at least # bytes
     109        uint16_t s_want_extra_isize; // New inodes should reserve # bytes
     110        uint32_t s_flags; // Miscellaneous flags
     111        uint16_t s_raid_stride; // RAID stride
     112        uint16_t s_mmp_interval; // # seconds to wait in MMP checking
     113        uint64_t s_mmp_block; // Block for multi-mount protection
     114        uint32_t s_raid_stripe_width; // blocks on all data disks (N*stride)
     115        uint8_t s_log_groups_per_flex; // FLEX_BG group size
     116        uint8_t s_reserved_char_pad;
     117        uint16_t s_reserved_pad;
     118        uint64_t s_kbytes_written; // Number of lifetime kilobytes written
     119        uint32_t s_snapshot_inum; // Inode number of active snapshot
     120        uint32_t s_snapshot_id; // Sequential ID of active snapshot
     121        uint64_t s_snapshot_r_blocks_count; /* reserved blocks for active snapshot's future use */
     122        uint32_t s_snapshot_list; // inode number of the head of the on-disk snapshot list
     123
     124        //#define EXT4_S_ERR_START offsetof(struct ext4_super_block, s_error_count)
     125        uint32_t s_error_count; // number of fs errors
     126        uint32_t s_first_error_time; // First time an error happened
     127        uint32_t s_first_error_ino; // Inode involved in first error
     128        uint64_t s_first_error_block; // block involved of first error
     129        uint8_t s_first_error_func[32]; // Function where the error happened
     130        uint32_t s_first_error_line; // Line number where error happened
     131        uint32_t s_last_error_time; // Most recent time of an error
     132        uint32_t s_last_error_ino; // Inode involved in last error
     133        uint32_t s_last_error_line; // Line number where error happened
     134        uint64_t s_last_error_block;     /* block involved of last error */
     135        uint8_t s_last_error_func[32];  /* function where the error happened */
     136        //#define EXT4_S_ERR_END offsetof(struct ext4_super_block, s_mount_opts)
     137        uint8_t s_mount_opts[64];
     138        uint32_t s_reserved[112]; // Padding to the end of the block
     139
     140} __attribute__((packed)) ext4_superblock_t;
    35141
    36142
Note: See TracChangeset for help on using the changeset viewer.