diff --git a/sys/fs/ext2fs/ext2_alloc.c b/sys/fs/ext2fs/ext2_alloc.c index 15b8354bda51..71e3612c4d1b 100644 --- a/sys/fs/ext2fs/ext2_alloc.c +++ b/sys/fs/ext2fs/ext2_alloc.c @@ -46,10 +46,10 @@ #include #include +#include #include #include #include -#include #include static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int); diff --git a/sys/fs/ext2fs/ext2_balloc.c b/sys/fs/ext2fs/ext2_balloc.c index 81e2d3c46a91..c71de89ad255 100644 --- a/sys/fs/ext2fs/ext2_balloc.c +++ b/sys/fs/ext2fs/ext2_balloc.c @@ -44,11 +44,13 @@ #include #include +#include #include #include -#include +#include #include #include + /* * Balloc defines the structure of filesystem storage * by allocating the physical blocks on a device given diff --git a/sys/fs/ext2fs/ext2_dinode.h b/sys/fs/ext2fs/ext2_dinode.h index 253b5d45d106..1526cb5bf3c5 100644 --- a/sys/fs/ext2fs/ext2_dinode.h +++ b/sys/fs/ext2fs/ext2_dinode.h @@ -80,6 +80,16 @@ #define E2DI_HAS_XTIME(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ EXT2F_ROCOMPAT_EXTRA_ISIZE)) +/* + * Constants relative to the data blocks + */ +#define EXT2_NDIR_BLOCKS 12 +#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS +#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) +#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) +#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) +#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) + /* * Structure of an inode on the disk */ diff --git a/sys/fs/ext2fs/ext2fs.h b/sys/fs/ext2fs/ext2fs.h index 225d0c1c86b8..bdc894e3490e 100644 --- a/sys/fs/ext2fs/ext2fs.h +++ b/sys/fs/ext2fs/ext2fs.h @@ -44,26 +44,6 @@ */ #define EXT2_LINK_MAX 32000 -/* - * A summary of contiguous blocks of various sizes is maintained - * in each cylinder group. Normally this is set by the initial - * value of fs_maxcontig. - * - * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set - * EXT2_MAXCONTIG to 32 for better performance. - */ -#define EXT2_MAXCONTIG 32 - -/* - * Constants relative to the data blocks - */ -#define EXT2_NDIR_BLOCKS 12 -#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS -#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) -#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) -#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) -#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) - /* * The path name on which the file system is mounted is maintained * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in @@ -175,11 +155,12 @@ struct m_ext2fs { struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ }; -/* - * The second extended file system version - */ -#define E2FS_DATE "95/08/09" -#define E2FS_VERSION "0.5b" +/* cluster summary information */ + +struct csum { + int8_t cs_init; /* cluster summary has been initialized */ + int32_t *cs_sum; /* cluster summary array */ +}; /* * The second extended file system magic number @@ -192,9 +173,6 @@ struct m_ext2fs { #define E2FS_REV0 0 /* The good old (original) format */ #define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ -#define E2FS_CURRENT_REV E2FS_REV0 -#define E2FS_MAX_SUPP_REV E2FS_REV1 - #define E2FS_REV0_INODE_SIZE 128 /* @@ -250,23 +228,6 @@ struct m_ext2fs { #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->e2fs->e2fs_features_incompat & htole32(mask) ) -/* - * Definitions of behavior on errors - */ -#define E2FS_BEH_CONTINUE 1 /* continue operation */ -#define E2FS_BEH_READONLY 2 /* remount fs read only */ -#define E2FS_BEH_PANIC 3 /* cause panic */ -#define E2FS_BEH_DEFAULT E2FS_BEH_CONTINUE - -/* - * OS identification - */ -#define E2FS_OS_LINUX 0 -#define E2FS_OS_HURD 1 -#define E2FS_OS_MASIX 2 -#define E2FS_OS_FREEBSD 3 -#define E2FS_OS_LITES 4 - /* * File clean flags */ @@ -290,12 +251,6 @@ struct ext2_gd { uint16_t ext2bgd_csum; /* group descriptor checksum */ }; -/* cluster summary information */ - -struct csum { - int8_t cs_init; /* cluster summary has been initialized */ - int32_t *cs_sum; /* cluster summary array */ -}; /* EXT2FS metadatas are stored in little-endian byte order. These macros * helps reading these metadatas diff --git a/sys/fs/ext2fs/fs.h b/sys/fs/ext2fs/fs.h index 7068e79c1df4..583e9ed9b40d 100644 --- a/sys/fs/ext2fs/fs.h +++ b/sys/fs/ext2fs/fs.h @@ -64,6 +64,16 @@ */ #define MAXMNTLEN 512 +/* + * A summary of contiguous blocks of various sizes is maintained + * in each cylinder group. Normally this is set by the initial + * value of fs_maxcontig. + * + * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set + * EXT2_MAXCONTIG to 32 for better performance. + */ +#define EXT2_MAXCONTIG 32 + /* * Grigoriy Orlov has done some extensive work to fine * tune the layout preferences for directories within a filesystem. diff --git a/sys/fs/ext2fs/inode.h b/sys/fs/ext2fs/inode.h index 6cb85ca995ec..82525e9c14a0 100644 --- a/sys/fs/ext2fs/inode.h +++ b/sys/fs/ext2fs/inode.h @@ -41,14 +41,14 @@ #include #include -#define NDADDR 12 /* Direct addresses in inode. */ -#define NIADDR 3 /* Indirect addresses in inode. */ - /* * This must agree with the definition in . */ #define doff_t int32_t +#define NDADDR 12 /* Direct addresses in inode. */ +#define NIADDR 3 /* Indirect addresses in inode. */ + /* * The inode is used to describe each active (or recently active) file in the * EXT2FS filesystem. It is composed of two types of information. The first