From owner-svn-src-head@FreeBSD.ORG Sun Jun 16 16:10:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7392DB47; Sun, 16 Jun 2013 16:10:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 656991DF3; Sun, 16 Jun 2013 16:10:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5GGAlpQ086106; Sun, 16 Jun 2013 16:10:47 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5GGAk6x086100; Sun, 16 Jun 2013 16:10:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306161610.r5GGAk6x086100@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 16 Jun 2013 16:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251809 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 16:10:47 -0000 Author: pfg Date: Sun Jun 16 16:10:45 2013 New Revision: 251809 URL: http://svnweb.freebsd.org/changeset/base/251809 Log: 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 Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun Jun 16 16:07:34 2013 (r251808) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun Jun 16 16:10:45 2013 (r251809) @@ -46,10 +46,10 @@ #include #include +#include #include #include #include -#include #include static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int); Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Sun Jun 16 16:07:34 2013 (r251808) +++ head/sys/fs/ext2fs/ext2_balloc.c Sun Jun 16 16:10:45 2013 (r251809) @@ -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 Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Sun Jun 16 16:07:34 2013 (r251808) +++ head/sys/fs/ext2fs/ext2_dinode.h Sun Jun 16 16:10:45 2013 (r251809) @@ -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 { Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Sun Jun 16 16:07:34 2013 (r251808) +++ head/sys/fs/ext2fs/ext2fs.h Sun Jun 16 16:10:45 2013 (r251809) @@ -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 Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Sun Jun 16 16:07:34 2013 (r251808) +++ head/sys/fs/ext2fs/fs.h Sun Jun 16 16:10:45 2013 (r251809) @@ -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 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 Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Sun Jun 16 16:07:34 2013 (r251808) +++ head/sys/fs/ext2fs/inode.h Sun Jun 16 16:10:45 2013 (r251809) @@ -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