Whamcloud - gitweb
LU-668 mdd: Rename MDS_*_FL to LUSTRE_*_FL and update usage
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 24 Aug 2011 16:58:20 +0000 (09:58 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Dec 2011 18:11:42 +0000 (13:11 -0500)
Fully remove MDS_*_FL and replace them with LUSTE_*_FL.  These
values are explictly not defined using LDISKFS_*_FL as was
done in mdd_internal.h to avoid a dependency on ldiskfs.h.

"These flags are part of the wire protocol.  We already have
portable definitions of these as "MDS_APPEND_FL", et. al.
in lustre_idl.h.  Since MDS_*_FL is no longer used in the
Lustre code (in preference to LUSTRE_*_FL), it makes sense
to just rename these in lustre_idl.h, and their corresponding
uses in wire*.c."
    -- Andreas

This was originally filed as Lustre bugzilla 22408.

Change-Id: Ib606bd43a93fc7c53f1660cc63751ec4ff9a76ed
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-on: http://review.whamcloud.com/1349
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/contrib/packet-lustre.c
lustre/include/lustre/lustre_idl.h
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index c75cace..5250364 100644 (file)
@@ -1028,13 +1028,13 @@ const value_string lustre_llog_hdr_llh_flags[]= {
 };
 
 const value_string lustre_mds_flags_vals[] = {
-  {0x1,"MDS_BFLAG_UNCOMMITTED_WRITES"},
-  {0x80000000, "MDS_BFLAG_EXT_FLAGS"},      /* == EXT3_RESERVED_FL */
-  {0x00000008, "MDS_SYNC_FL        "},      /* Synchronous updates */
-  {0x00000010, "MDS_IMMUTABLE_FL   "},      /* Immutable file */
-  {0x00000020, "MDS_APPEND_FL      "},      /* writes to file may only append */
-  {0x00000080, "MDS_NOATIME_FL     "},      /* do not update atime */
-  {0x00010000, "MDS_DIRSYNC_FL     "},       /* dirsync behaviour (dir only) */
+  {0x1,        "LUSTRE_BFLAG_UNCOMMITTED_WRITES"},
+  {0x80000000, "LUSTRE_BFLAG_EXT_FLAGS"},   /* == EXT3_RESERVED_FL */
+  {0x00000008, "LUSTRE_SYNC_FL        "},   /* Synchronous updates */
+  {0x00000010, "LUSTRE_IMMUTABLE_FL   "},   /* Immutable file */
+  {0x00000020, "LUSTRE_APPEND_FL      "},   /* writes to file may only append */
+  {0x00000080, "LUSTRE_NOATIME_FL     "},   /* do not update atime */
+  {0x00010000, "LUSTRE_DIRSYNC_FL     "},   /* dirsync behaviour (dir only) */
   { 0, NULL }
 };
 
index 9bb4bbf..d8a4550 100644 (file)
@@ -1574,43 +1574,43 @@ enum md_op_flags {
 
 #define MF_SOM_LOCAL_FLAGS (MF_SOM_CHANGE | MF_EPOCH_OPEN | MF_EPOCH_CLOSE)
 
-#define MDS_BFLAG_UNCOMMITTED_WRITES   0x1
+#define LUSTRE_BFLAG_UNCOMMITTED_WRITES   0x1
 
-/* these should be identical to their EXT3_*_FL counterparts, and are
- * redefined here only to avoid dragging in ext3_fs.h */
-#define MDS_SYNC_FL             0x00000008 /* Synchronous updates */
-#define MDS_IMMUTABLE_FL        0x00000010 /* Immutable file */
-#define MDS_APPEND_FL           0x00000020 /* writes to file may only append */
-#define MDS_NOATIME_FL          0x00000080 /* do not update atime */
-#define MDS_DIRSYNC_FL          0x00010000 /* dirsync behaviour (dir only) */
+/* these should be identical to their EXT4_*_FL counterparts, they are
+ * redefined here only to avoid dragging in fs/ext4/ext4.h */
+#define LUSTRE_SYNC_FL         0x00000008 /* Synchronous updates */
+#define LUSTRE_IMMUTABLE_FL    0x00000010 /* Immutable file */
+#define LUSTRE_APPEND_FL       0x00000020 /* writes to file may only append */
+#define LUSTRE_NOATIME_FL      0x00000080 /* do not update atime */
+#define LUSTRE_DIRSYNC_FL      0x00010000 /* dirsync behaviour (dir only) */
 
 #ifdef __KERNEL__
-/* Convert wire MDS_*_FL to corresponding client local VFS S_* values
- * for the client inode i_flags.  The MDS_*_FL are the Lustre wire
+/* Convert wire LUSTRE_*_FL to corresponding client local VFS S_* values
+ * for the client inode i_flags.  The LUSTRE_*_FL are the Lustre wire
  * protocol equivalents of LDISKFS_*_FL values stored on disk, while
  * the S_* flags are kernel-internal values that change between kernel
  * versions.  These flags are set/cleared via FSFILT_IOC_{GET,SET}_FLAGS.
  * See b=16526 for a full history. */
 static inline int ll_ext_to_inode_flags(int flags)
 {
-        return (((flags & MDS_SYNC_FL)      ? S_SYNC      : 0) |
-                ((flags & MDS_NOATIME_FL)   ? S_NOATIME   : 0) |
-                ((flags & MDS_APPEND_FL)    ? S_APPEND    : 0) |
+        return (((flags & LUSTRE_SYNC_FL)      ? S_SYNC      : 0) |
+                ((flags & LUSTRE_NOATIME_FL)   ? S_NOATIME   : 0) |
+                ((flags & LUSTRE_APPEND_FL)    ? S_APPEND    : 0) |
 #if defined(S_DIRSYNC)
-                ((flags & MDS_DIRSYNC_FL)   ? S_DIRSYNC   : 0) |
+                ((flags & LUSTRE_DIRSYNC_FL)   ? S_DIRSYNC   : 0) |
 #endif
-                ((flags & MDS_IMMUTABLE_FL) ? S_IMMUTABLE : 0));
+                ((flags & LUSTRE_IMMUTABLE_FL) ? S_IMMUTABLE : 0));
 }
 
 static inline int ll_inode_to_ext_flags(int iflags)
 {
-        return (((iflags & S_SYNC)      ? MDS_SYNC_FL      : 0) |
-                ((iflags & S_NOATIME)   ? MDS_NOATIME_FL   : 0) |
-                ((iflags & S_APPEND)    ? MDS_APPEND_FL    : 0) |
+        return (((iflags & S_SYNC)      ? LUSTRE_SYNC_FL      : 0) |
+                ((iflags & S_NOATIME)   ? LUSTRE_NOATIME_FL   : 0) |
+                ((iflags & S_APPEND)    ? LUSTRE_APPEND_FL    : 0) |
 #if defined(S_DIRSYNC)
-                ((iflags & S_DIRSYNC)   ? MDS_DIRSYNC_FL   : 0) |
+                ((iflags & S_DIRSYNC)   ? LUSTRE_DIRSYNC_FL   : 0) |
 #endif
-                ((iflags & S_IMMUTABLE) ? MDS_IMMUTABLE_FL : 0));
+                ((iflags & S_IMMUTABLE) ? LUSTRE_IMMUTABLE_FL : 0));
 }
 #endif
 
@@ -1632,7 +1632,7 @@ struct mdt_body {
         __u32          mode;
         __u32          uid;
         __u32          gid;
-        __u32          flags; /* from vfs for pin/unpin, MDS_BFLAG for close */
+        __u32          flags; /* from vfs for pin/unpin, LUSTRE_BFLAG close */
         __u32          rdev;
         __u32          nlink; /* #bytes to read in the case of MDS_READPAGE */
         __u32          generation;
index e2ee0f2..5088814 100644 (file)
@@ -147,10 +147,6 @@ enum mod_flags {
         MNLINK_OBJ = 1 << 4
 };
 
-#define LUSTRE_APPEND_FL LDISKFS_APPEND_FL
-#define LUSTRE_IMMUTABLE_FL LDISKFS_IMMUTABLE_FL
-#define LUSTRE_DIRSYNC_FL LDISKFS_DIRSYNC_FL
-
 enum mdd_object_role {
         MOR_SRC_PARENT,
         MOR_SRC_CHILD,
index 2ae3f53..5320344 100644 (file)
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include <linux/module.h>
-#ifdef HAVE_EXT4_LDISKFS
-#include <ldiskfs/ldiskfs_jbd2.h>
-#else
-#include <linux/jbd.h>
-#endif
 #include <obd.h>
 #include <obd_class.h>
 #include <obd_support.h>
 #include <lustre_fid.h>
 
 #include <lustre_param.h>
-#ifdef HAVE_EXT4_LDISKFS
-#include <ldiskfs/ldiskfs.h>
-#else
-#include <linux/ldiskfs_fs.h>
-#endif
 #include <lustre_mds.h>
 #include <lustre/lustre_idl.h>
 
index b76757d..002e61a 100644 (file)
@@ -220,8 +220,8 @@ void lustre_assert_wire_constants(void)
                  (long long)MDS_STATUS_CONN);
         LASSERTF(MDS_STATUS_LOV == 2, "found %lld\n",
                  (long long)MDS_STATUS_LOV);
-        LASSERTF(MDS_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n",
-                 (long long)MDS_BFLAG_UNCOMMITTED_WRITES);
+        LASSERTF(LUSTRE_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n",
+                 (long long)LUSTRE_BFLAG_UNCOMMITTED_WRITES);
         LASSERTF(MF_SOM_CHANGE == 0x00000001UL, "found 0x%.8xUL\n",
                  (unsigned)MF_SOM_CHANGE);
         LASSERTF(MF_EPOCH_OPEN == 0x00000002UL, "found 0x%.8xUL\n",
@@ -1762,16 +1762,16 @@ void lustre_assert_wire_constants(void)
                  (long long)MDS_OPEN_NORESTORE);
         LASSERTF(MDS_OPEN_NEWSTRIPE == 00000000000200000000000ULL, "found 0%.22lloULL\n",
                  (long long)MDS_OPEN_NEWSTRIPE);
-        LASSERTF(MDS_SYNC_FL == 0x00000008, "found 0x%.8x\n",
-                 MDS_SYNC_FL);
-        LASSERTF(MDS_IMMUTABLE_FL == 0x00000010, "found 0x%.8x\n",
-                 MDS_IMMUTABLE_FL);
-        LASSERTF(MDS_APPEND_FL == 0x00000020, "found 0x%.8x\n",
-                 MDS_APPEND_FL);
-        LASSERTF(MDS_NOATIME_FL == 0x00000080, "found 0x%.8x\n",
-                 MDS_NOATIME_FL);
-        LASSERTF(MDS_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n",
-                 MDS_DIRSYNC_FL);
+        LASSERTF(LUSTRE_SYNC_FL == 0x00000008, "found 0x%.8x\n",
+                 LUSTRE_SYNC_FL);
+        LASSERTF(LUSTRE_IMMUTABLE_FL == 0x00000010, "found 0x%.8x\n",
+                 LUSTRE_IMMUTABLE_FL);
+        LASSERTF(LUSTRE_APPEND_FL == 0x00000020, "found 0x%.8x\n",
+                 LUSTRE_APPEND_FL);
+        LASSERTF(LUSTRE_NOATIME_FL == 0x00000080, "found 0x%.8x\n",
+                 LUSTRE_NOATIME_FL);
+        LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n",
+                 LUSTRE_DIRSYNC_FL);
         LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n",
                  MDS_INODELOCK_LOOKUP);
         LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",
index e61faef..f5b331e 100644 (file)
@@ -786,11 +786,11 @@ check_mdt_body(void)
 
         /* these should be identical to their EXT3_*_FL counterparts, and
          * are redefined only to avoid dragging in ext3_fs.h */
-        CHECK_DEFINE_X(MDS_SYNC_FL);
-        CHECK_DEFINE_X(MDS_IMMUTABLE_FL);
-        CHECK_DEFINE_X(MDS_APPEND_FL);
-        CHECK_DEFINE_X(MDS_NOATIME_FL);
-        CHECK_DEFINE_X(MDS_DIRSYNC_FL);
+        CHECK_DEFINE_X(LUSTRE_SYNC_FL);
+        CHECK_DEFINE_X(LUSTRE_IMMUTABLE_FL);
+        CHECK_DEFINE_X(LUSTRE_APPEND_FL);
+        CHECK_DEFINE_X(LUSTRE_NOATIME_FL);
+        CHECK_DEFINE_X(LUSTRE_DIRSYNC_FL);
 
         CHECK_DEFINE_X(MDS_INODELOCK_LOOKUP);
         CHECK_DEFINE_X(MDS_INODELOCK_UPDATE);
@@ -1886,7 +1886,7 @@ main(int argc, char **argv)
         CHECK_VALUE(MDS_STATUS_CONN);
         CHECK_VALUE(MDS_STATUS_LOV);
 
-        CHECK_VALUE(MDS_BFLAG_UNCOMMITTED_WRITES);
+        CHECK_VALUE(LUSTRE_BFLAG_UNCOMMITTED_WRITES);
 
         CHECK_VALUE_X(MF_SOM_CHANGE);
         CHECK_VALUE_X(MF_EPOCH_OPEN);
index aea1297..21dc04f 100644 (file)
@@ -217,8 +217,8 @@ void lustre_assert_wire_constants(void)
                  (long long)MDS_STATUS_CONN);
         LASSERTF(MDS_STATUS_LOV == 2, "found %lld\n",
                  (long long)MDS_STATUS_LOV);
-        LASSERTF(MDS_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n",
-                 (long long)MDS_BFLAG_UNCOMMITTED_WRITES);
+        LASSERTF(LUSTRE_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n",
+                 (long long)LUSTRE_BFLAG_UNCOMMITTED_WRITES);
         LASSERTF(MF_SOM_CHANGE == 0x00000001UL, "found 0x%.8xUL\n",
                  (unsigned)MF_SOM_CHANGE);
         LASSERTF(MF_EPOCH_OPEN == 0x00000002UL, "found 0x%.8xUL\n",
@@ -1759,16 +1759,16 @@ void lustre_assert_wire_constants(void)
                  (long long)MDS_OPEN_NORESTORE);
         LASSERTF(MDS_OPEN_NEWSTRIPE == 00000000000200000000000ULL, "found 0%.22lloULL\n",
                  (long long)MDS_OPEN_NEWSTRIPE);
-        LASSERTF(MDS_SYNC_FL == 0x00000008, "found 0x%.8x\n",
-                 MDS_SYNC_FL);
-        LASSERTF(MDS_IMMUTABLE_FL == 0x00000010, "found 0x%.8x\n",
-                 MDS_IMMUTABLE_FL);
-        LASSERTF(MDS_APPEND_FL == 0x00000020, "found 0x%.8x\n",
-                 MDS_APPEND_FL);
-        LASSERTF(MDS_NOATIME_FL == 0x00000080, "found 0x%.8x\n",
-                 MDS_NOATIME_FL);
-        LASSERTF(MDS_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n",
-                 MDS_DIRSYNC_FL);
+        LASSERTF(LUSTRE_SYNC_FL == 0x00000008, "found 0x%.8x\n",
+                 LUSTRE_SYNC_FL);
+        LASSERTF(LUSTRE_IMMUTABLE_FL == 0x00000010, "found 0x%.8x\n",
+                 LUSTRE_IMMUTABLE_FL);
+        LASSERTF(LUSTRE_APPEND_FL == 0x00000020, "found 0x%.8x\n",
+                 LUSTRE_APPEND_FL);
+        LASSERTF(LUSTRE_NOATIME_FL == 0x00000080, "found 0x%.8x\n",
+                 LUSTRE_NOATIME_FL);
+        LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n",
+                 LUSTRE_DIRSYNC_FL);
         LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n",
                  MDS_INODELOCK_LOOKUP);
         LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",