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 <sys/types.h>
 
-/*
- * 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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to