83 lines
3.2 KiB
C
83 lines
3.2 KiB
C
// ext2.h
|
|
// Author: Josh Holtrop
|
|
// Date: 08/22/04
|
|
// Modified: 08/22/04
|
|
|
|
#ifndef __HOS_EXT2_H__
|
|
#define __HOS_EXT2_H__ __HOS_EXT2_H__
|
|
|
|
#include "hos_defines.h"
|
|
#include "fs/devices.h"
|
|
|
|
typedef struct {
|
|
u32_t s_inodes_count; /* Inodes count */
|
|
u32_t s_blocks_count; /* Blocks count */
|
|
u32_t s_r_blocks_count; /* Reserved blocks count */
|
|
u32_t s_free_blocks_count; /* Free blocks count */
|
|
u32_t s_free_inodes_count; /* Free inodes count */
|
|
u32_t s_first_data_block; /* First Data Block */
|
|
u32_t s_log_block_size; /* Block size */
|
|
int s_log_frag_size; /* Fragment size */
|
|
u32_t s_blocks_per_group; /* # Blocks per group */
|
|
u32_t s_frags_per_group; /* # Fragments per group */
|
|
u32_t s_inodes_per_group; /* # Inodes per group */
|
|
u32_t s_mtime; /* Mount time */
|
|
u32_t s_wtime; /* Write time */
|
|
u16_t s_mnt_count; /* Mount count */
|
|
short s_max_mnt_count; /* Maximal mount count */
|
|
u16_t s_magic; /* Magic signature */
|
|
u16_t s_state; /* File system state */
|
|
u16_t s_errors; /* Behaviour when detecting errors */
|
|
u16_t s_minor_rev_level; /* minor revision level */
|
|
u32_t s_lastcheck; /* time of last check */
|
|
u32_t s_checkinterval; /* max. time between checks */
|
|
u32_t s_creator_os; /* OS */
|
|
u32_t s_rev_level; /* Revision level */
|
|
u16_t s_def_resuid; /* Default uid for reserved blocks */
|
|
u16_t s_def_resgid; /* Default gid for reserved blocks */
|
|
|
|
/*
|
|
* EXT2_DYNAMIC_REV fields...
|
|
*/
|
|
u32_t s_first_ino; /* First non-reserved inode */
|
|
u16_t s_inode_size; /* size of inode structure */
|
|
u16_t s_block_group_nr; /* block group # of this superblock */
|
|
u32_t s_feature_compat; /* compatible feature set */
|
|
u32_t s_feature_incompat; /* incompatible feature set */
|
|
u32_t s_feature_ro_compat; /* readonly-compatible feature set */
|
|
u8_t s_uuid[16]; /* 128-bit uuid for volume */
|
|
char s_volume_name[16]; /* volume name */
|
|
char s_last_mounted[64]; /* directory where last mounted */
|
|
u32_t s_algorithm_usage_bitmap; /* For compression */
|
|
|
|
/*
|
|
* Performance hints...
|
|
*/
|
|
u8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
|
|
u8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
|
|
u16_t s_padding1;
|
|
|
|
/*
|
|
* Journaling information...
|
|
*/
|
|
u8_t s_journal_uuid[16]; /* uuid of journal superblock */
|
|
u32_t s_journal_inum; /* inode number of journal file */
|
|
u32_t s_journal_dev; /* device number of journal file */
|
|
u32_t s_last_orphan; /* start of list of inodes to delete */
|
|
u32_t s_hash_seed[4]; /* HTREE hash seed */
|
|
u8_t s_def_hash_version; /* Default hash version to use */
|
|
u8_t s_reserved_char_pad;
|
|
u16_t s_reserved_word_pad;
|
|
u32_t s_default_mount_opts;
|
|
u32_t s_first_meta_bg; /* First metablock block group */
|
|
u32_t s_reserved[190]; /* Padding to the end of the block */
|
|
|
|
} ext2_super_block_t;
|
|
|
|
|
|
void ext2_read_super(major_t major, minor_t minor);
|
|
|
|
|
|
#endif
|
|
|