[Ocfs2-tools-devel] [patch 1/9] Adds some macros in the header files, take 4

tao.ma at oracle.com tao.ma at oracle.com
Wed Jul 11 02:01:05 PDT 2007


Add macro "OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG" in ocfs2_fs.h to protect users
from inadvertently mounting the fs after an aborted run without fsck-ing.
Add field "s_tunefs_flag" in ocfs2_super_block to indicate the real reason of
aborted tunefs.ocfs2.

Add "OCFS2_LIB_ABORTED_TUNEFS_SUPP" for checking aborted tunefs operations.

Index: new.ocfs2-tools/libocfs2/include/ocfs2.h
===================================================================
--- new.ocfs2-tools.orig/libocfs2/include/ocfs2.h	2007-07-10 16:35:21.000000000 -0400
+++ new.ocfs2-tools/libocfs2/include/ocfs2.h	2007-07-10 16:36:36.000000000 -0400
@@ -76,12 +76,15 @@
 #define OCFS2_LIB_FEATURE_INCOMPAT_SUPP		(OCFS2_FEATURE_INCOMPAT_SUPP | \
 						 OCFS2_FEATURE_INCOMPAT_HEARTBEAT_DEV | \
 						 OCFS2_FEATURE_INCOMPAT_RESIZE_INPROG | \
-						 OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT)
+						 OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT   | \
+						 OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG)
 
 #define OCFS2_LIB_FEATURE_RO_COMPAT_SUPP	OCFS2_FEATURE_RO_COMPAT_SUPP
 
 #define OCFS2_LIB_FEATURE_COMPAT_SUPP		OCFS2_FEATURE_COMPAT_SUPP
 
+#define OCFS2_LIB_ABORTED_TUNEFS_SUPP		OCFS2_TUNEFS_INPROG_REMOVE_SLOT
+
 /* define OCFS2_SB for ocfs2-tools */
 #define OCFS2_SB(sb)	(sb)
 
Index: new.ocfs2-tools/libocfs2/include/ocfs2_fs.h
===================================================================
--- new.ocfs2-tools.orig/libocfs2/include/ocfs2_fs.h	2007-07-10 16:35:21.000000000 -0400
+++ new.ocfs2-tools/libocfs2/include/ocfs2_fs.h	2007-07-10 16:36:36.000000000 -0400
@@ -109,6 +109,15 @@
 /* Support for sparse allocation in b-trees */
 #define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC	0x0010
 
+/* tunefs sets this incompat flag before starting the operation and clears it
+ * at the end. This flag protects users from inadvertently mounting the fs
+ * after an aborted run without fsck-ing.
+ */
+#define OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG	0x0020
+
+/* tunefs set this in s_tunefs_flag when removing slots. */
+#define OCFS2_TUNEFS_INPROG_REMOVE_SLOT		0x0001
+
 /*
  * backup superblock flag is used to indicate that this volume
  * has backup superblocks.
@@ -393,8 +402,8 @@ struct ocfs2_super_block {
 	__le32 s_clustersize_bits;	/* Clustersize for this fs */
 /*40*/	__le16 s_max_slots;		/* Max number of simultaneous mounts
 					   before tunefs required */
-	__le16 s_reserved1;
-	__le32 s_reserved2;
+	__le16 s_tunefs_flag;
+	__le32 s_reserved1;
 	__le64 s_first_cluster_group;	/* Block offset of 1st cluster
 					 * group header */
 /*50*/	__u8  s_label[OCFS2_MAX_VOL_LABEL_LEN];	/* Label for mounting, etc. */

-- 



More information about the Ocfs2-tools-devel mailing list