From owner-svn-src-head@FreeBSD.ORG Fri Jan 21 22:00:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68183106564A; Fri, 21 Jan 2011 22:00:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B24D8FC08; Fri, 21 Jan 2011 22:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0LM0fSA069164; Fri, 21 Jan 2011 22:00:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0LM0fKj069162; Fri, 21 Jan 2011 22:00:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101212200.p0LM0fKj069162@svn.freebsd.org> From: John Baldwin Date: Fri, 21 Jan 2011 22:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217703 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 21 Jan 2011 22:00:41 -0000 Author: jhb Date: Fri Jan 21 22:00:40 2011 New Revision: 217703 URL: http://svn.freebsd.org/changeset/base/217703 Log: - Move special inode constants to ext2_dinode.h and rename them to match NetBSD. - Add a constant for the HASJOURNAL compat flag. PR: kern/153584 Submitted by: Pedro F. Giffuni giffunip at yahoo Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Fri Jan 21 21:33:46 2011 (r217702) +++ head/sys/fs/ext2fs/ext2_dinode.h Fri Jan 21 22:00:40 2011 (r217703) @@ -32,6 +32,23 @@ #define e2di_size_high e2di_dacl /* + * Special inode numbers + * The root inode is the root of the file system. Inode 0 can't be used for + * normal purposes and bad blocks are normally linked to inode 1, thus + * the root inode is 2. + * Inode 3 to 10 are reserved in ext2fs. + */ +#define EXT2_BADBLKINO ((ino_t)1) +#define EXT2_ROOTINO ((ino_t)2) +#define EXT2_ACLIDXINO ((ino_t)3) +#define EXT2_ACLDATAINO ((ino_t)4) +#define EXT2_BOOTLOADERINO ((ino_t)5) +#define EXT2_UNDELDIRINO ((ino_t)6) +#define EXT2_RESIZEINO ((ino_t)7) +#define EXT2_JOURNALINO ((ino_t)8) +#define EXT2_FIRSTINO ((ino_t)11) + +/* * Inode flags * The current implementation uses only EXT2_IMMUTABLE and EXT2_APPEND flags */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Jan 21 21:33:46 2011 (r217702) +++ head/sys/fs/ext2fs/ext2fs.h Fri Jan 21 22:00:40 2011 (r217703) @@ -39,22 +39,6 @@ #include -/* - * Special inode numbers - */ -#define EXT2_BAD_INO 1 /* Bad blocks inode */ -#define EXT2_ROOT_INO 2 /* Root inode */ -#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ -#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ - -/* First non-reserved inode for old ext2 filesystems */ -#define E2FS_REV0_FIRST_INO 11 - -/* - * The second extended file system magic number - */ -#define E2FS_MAGIC 0xEF53 - #if defined(_KERNEL) /* * FreeBSD passes the pointer to the in-core struct with relevant @@ -170,7 +154,7 @@ struct m_ext2fs { uint32_t e2fs_mount_opt; uint32_t e2fs_blocksize_bits; uint32_t e2fs_total_dir; /* Total number of directories */ - uint8_t *e2fs_contigdirs; + uint8_t *e2fs_contigdirs; /* (u) # of contig. allocated dirs */ char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ @@ -182,6 +166,14 @@ struct m_ext2fs { #define E2FS_DATE "95/08/09" #define E2FS_VERSION "0.5b" +/* First non-reserved inode for old ext2 filesystems */ +#define E2FS_REV0_FIRST_INO 11 + +/* + * The second extended file system magic number + */ +#define E2FS_MAGIC 0xEF53 + /* * Revision levels */ @@ -197,6 +189,7 @@ struct m_ext2fs { * compatible/incompatible features */ #define EXT2F_COMPAT_PREALLOC 0x0001 +#define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001