summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2010-02-16 08:24:14 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2010-02-16 08:24:14 +0000
commit15528e21a56b3069df478d4e6a8fb58980f28411 (patch)
tree0b94aee129dbc167b53ae55aa6d68556acc955b1 /sys/ufs
parent7147f61edc347ecf8bf6a0313c08209a0fe5bcdd (diff)
add some defines needed for the upcoming newfs_ext2fs; ok miod@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ext2fs/ext2fs.h15
-rw-r--r--sys/ufs/ext2fs/ext2fs_dinode.h8
2 files changed, 19 insertions, 4 deletions
diff --git a/sys/ufs/ext2fs/ext2fs.h b/sys/ufs/ext2fs/ext2fs.h
index 7b007344dcd..f471f163679 100644
--- a/sys/ufs/ext2fs/ext2fs.h
+++ b/sys/ufs/ext2fs/ext2fs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs.h,v 1.13 2008/01/05 19:49:26 otto Exp $ */
+/* $OpenBSD: ext2fs.h,v 1.14 2010/02/16 08:24:13 otto Exp $ */
/* $NetBSD: ext2fs.h,v 1.10 2000/01/28 16:00:23 bouyer Exp $ */
/*
@@ -136,7 +136,7 @@ struct ext2fs {
u_int32_t e2fs_algo; /* For compression */
u_int8_t e2fs_prealloc; /* # of blocks to preallocate */
u_int8_t e2fs_dir_prealloc; /* # of blocks to preallocate for dir */
- u_int16_t pad1;
+ u_int16_t e2fs_reserved_ngdb; /* # of reserved gd blocks for resize */
u_int32_t reserved2[204];
};
@@ -170,6 +170,9 @@ struct m_ext2fs {
/* compatible/imcompatible features */
#define EXT2F_COMPAT_PREALLOC 0x0001
+#define EXT2F_COMPAT_HASJOURNAL 0x0004
+#define EXT2F_COMPAT_RESIZE 0x0010
+
#define EXT2F_ROCOMPAT_SPARSESUPER 0x0001
#define EXT2F_ROCOMPAT_LARGEFILE 0x0002
@@ -187,6 +190,14 @@ struct m_ext2fs {
#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE
/*
+ * 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
diff --git a/sys/ufs/ext2fs/ext2fs_dinode.h b/sys/ufs/ext2fs/ext2fs_dinode.h
index 1e823b62cd9..fcfcf2b17c8 100644
--- a/sys/ufs/ext2fs/ext2fs_dinode.h
+++ b/sys/ufs/ext2fs/ext2fs_dinode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_dinode.h,v 1.11 2008/11/23 23:52:35 tedu Exp $ */
+/* $OpenBSD: ext2fs_dinode.h,v 1.12 2010/02/16 08:24:13 otto Exp $ */
/* $NetBSD: ext2fs_dinode.h,v 1.6 2000/01/26 16:21:33 bouyer Exp $ */
/*
@@ -48,6 +48,7 @@
* Inode 3 to 10 are reserved in ext2fs.
*/
#define EXT2_ROOTINO ((ino_t)2)
+#define EXT2_RESIZEINO ((ino_t)7)
#define EXT2_FIRSTINO ((ino_t)11)
/*
@@ -118,7 +119,10 @@ struct ext2fs_dinode {
#define EXT2_NODUMP 0x00000040 /* do not dump file */
/* Size of on-disk inode. */
-#define EXT2_DINODE_SIZE(s) (s)->e2fs.e2fs_inode_size
+#define EXT2_REV0_DINODE_SIZE sizeof(struct ext2fs_dinode)
+#define EXT2_DINODE_SIZE(fs) ((fs)->e2fs.e2fs_rev > E2FS_REV0 ? \
+ (fs)->e2fs.e2fs_inode_size : \
+ EXT2_REV0_DINODE_SIZE)
/*
* The e2di_blocks fields may be overlaid with other information for