diff options
author | pfg <pfg@FreeBSD.org> | 2013-06-16 16:10:45 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-06-16 16:10:45 +0000 |
commit | 5cf909a854b7bc035f981644b2d917685474e997 (patch) | |
tree | 547ebe7c9446435ff299c1370d0a7bb7b7c1c370 /sys/fs | |
parent | 074ee391ff9933c3dab394b927c714ad377a6c44 (diff) | |
download | FreeBSD-src-5cf909a854b7bc035f981644b2d917685474e997.zip FreeBSD-src-5cf909a854b7bc035f981644b2d917685474e997.tar.gz |
Re-sort ext2fs headers to make things easier to find.
In the ext2fs driver we have a mixture of headers:
- The ext2_ prefixed headers have strong influence from NetBSD
and are carry specific ext2/3/4 information.
- The unprefixed headers are inspired on UFS and carry implementation
specific information.
Do some small adjustments so that the information is easier to
find coming from either UFS or the NetBSD implementation.
MFC after: 3 days
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/ext2fs/ext2_alloc.c | 2 | ||||
-rw-r--r-- | sys/fs/ext2fs/ext2_balloc.c | 4 | ||||
-rw-r--r-- | sys/fs/ext2fs/ext2_dinode.h | 10 | ||||
-rw-r--r-- | sys/fs/ext2fs/ext2fs.h | 57 | ||||
-rw-r--r-- | sys/fs/ext2fs/fs.h | 10 | ||||
-rw-r--r-- | sys/fs/ext2fs/inode.h | 6 |
6 files changed, 33 insertions, 56 deletions
diff --git a/sys/fs/ext2fs/ext2_alloc.c b/sys/fs/ext2fs/ext2_alloc.c index 15b8354..71e3612 100644 --- a/sys/fs/ext2fs/ext2_alloc.c +++ b/sys/fs/ext2fs/ext2_alloc.c @@ -46,10 +46,10 @@ #include <sys/syslog.h> #include <sys/buf.h> +#include <fs/ext2fs/fs.h> #include <fs/ext2fs/inode.h> #include <fs/ext2fs/ext2_mount.h> #include <fs/ext2fs/ext2fs.h> -#include <fs/ext2fs/fs.h> #include <fs/ext2fs/ext2_extern.h> 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 81e2d3c..c71de89 100644 --- a/sys/fs/ext2fs/ext2_balloc.c +++ b/sys/fs/ext2fs/ext2_balloc.c @@ -44,11 +44,13 @@ #include <sys/mount.h> #include <sys/vnode.h> +#include <fs/ext2fs/fs.h> #include <fs/ext2fs/inode.h> #include <fs/ext2fs/ext2fs.h> -#include <fs/ext2fs/fs.h> +#include <fs/ext2fs/ext2_dinode.h> #include <fs/ext2fs/ext2_extern.h> #include <fs/ext2fs/ext2_mount.h> + /* * 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 253b5d4..1526cb5 100644 --- a/sys/fs/ext2fs/ext2_dinode.h +++ b/sys/fs/ext2fs/ext2_dinode.h @@ -81,6 +81,16 @@ 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 */ struct ext2fs_dinode { diff --git a/sys/fs/ext2fs/ext2fs.h b/sys/fs/ext2fs/ext2fs.h index 225d0c1..bdc894e 100644 --- a/sys/fs/ext2fs/ext2fs.h +++ b/sys/fs/ext2fs/ext2fs.h @@ -45,26 +45,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 * the super block for this name. @@ -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 /* @@ -251,23 +229,6 @@ struct m_ext2fs { ( 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 */ #define E2FS_ISCLEAN 0x0001 /* Unmounted cleanly */ @@ -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 7068e79..583e9ed9 100644 --- a/sys/fs/ext2fs/fs.h +++ b/sys/fs/ext2fs/fs.h @@ -65,6 +65,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 <gluk@ptci.ru> has done some extensive work to fine * tune the layout preferences for directories within a filesystem. * His algorithm can be tuned by adjusting the following parameters diff --git a/sys/fs/ext2fs/inode.h b/sys/fs/ext2fs/inode.h index 6cb85ca..82525e9 100644 --- a/sys/fs/ext2fs/inode.h +++ b/sys/fs/ext2fs/inode.h @@ -41,14 +41,14 @@ #include <sys/lock.h> #include <sys/queue.h> -#define NDADDR 12 /* Direct addresses in inode. */ -#define NIADDR 3 /* Indirect addresses in inode. */ - /* * This must agree with the definition in <ufs/ufs/dir.h>. */ #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 |