Whamcloud - gitweb
LU-1681 llite: remove unnecessary OBD_MD_MDTIDX
authorwangdi <di.wang@whamcloud.com>
Thu, 26 Jul 2012 12:47:25 +0000 (05:47 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 3 Dec 2012 17:22:56 +0000 (12:22 -0500)
Remove unnecessary OBD_MD_MDTIDX to save bits
for OBD_MD_XXX.

Signed-off-by: Wang Di <di.wang@whamcloud.com>
Change-Id: I80e4abdf861605e09879e6bc1d7c3da0ef06ad66
Reviewed-on: http://review.whamcloud.com/3481
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
lustre/include/lustre/lustre_idl.h
lustre/llite/dir.c
lustre/lmv/lmv_obd.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index a097158..394decc 100644 (file)
@@ -1501,7 +1501,10 @@ struct lov_mds_md_v3 {            /* LOV EA mds/wire data (little-endian) */
 #define OBD_MD_MDS         (0x0000000100000000ULL) /* where an inode lives on */
 #define OBD_MD_REINT       (0x0000000200000000ULL) /* reintegrate oa */
 #define OBD_MD_MEA         (0x0000000400000000ULL) /* CMD split EA  */
-#define OBD_MD_MDTIDX      (0x0000000800000000ULL) /* Get MDT index  */
+
+/* OBD_MD_MDTIDX is used to get MDT index, but it is never been used overwire,
+ * and it is already obsolete since 2.3 */
+/* #define OBD_MD_MDTIDX      (0x0000000800000000ULL) */
 
 #define OBD_MD_FLXATTR       (0x0000001000000000ULL) /* xattr */
 #define OBD_MD_FLXATTRLS     (0x0000002000000000ULL) /* xattr list */
@@ -1869,19 +1872,20 @@ enum {
 
 /* mdt_thread_info.mti_flags. */
 enum md_op_flags {
-        /* The flag indicates Size-on-MDS attributes are changed. */
-        MF_SOM_CHANGE           = (1 << 0),
-        /* Flags indicates an epoch opens or closes. */
-        MF_EPOCH_OPEN           = (1 << 1),
-        MF_EPOCH_CLOSE          = (1 << 2),
-        MF_MDC_CANCEL_FID1      = (1 << 3),
-        MF_MDC_CANCEL_FID2      = (1 << 4),
-        MF_MDC_CANCEL_FID3      = (1 << 5),
-        MF_MDC_CANCEL_FID4      = (1 << 6),
-        /* There is a pending attribute update. */
-        MF_SOM_AU               = (1 << 7),
-        /* Cancel OST locks while getattr OST attributes. */
-        MF_GETATTR_LOCK         = (1 << 8),
+       /* The flag indicates Size-on-MDS attributes are changed. */
+       MF_SOM_CHANGE           = (1 << 0),
+       /* Flags indicates an epoch opens or closes. */
+       MF_EPOCH_OPEN           = (1 << 1),
+       MF_EPOCH_CLOSE          = (1 << 2),
+       MF_MDC_CANCEL_FID1      = (1 << 3),
+       MF_MDC_CANCEL_FID2      = (1 << 4),
+       MF_MDC_CANCEL_FID3      = (1 << 5),
+       MF_MDC_CANCEL_FID4      = (1 << 6),
+       /* There is a pending attribute update. */
+       MF_SOM_AU               = (1 << 7),
+       /* Cancel OST locks while getattr OST attributes. */
+       MF_GETATTR_LOCK         = (1 << 8),
+       MF_GET_MDT_IDX          = (1 << 9),
 };
 
 #define MF_SOM_LOCAL_FLAGS (MF_SOM_CHANGE | MF_EPOCH_OPEN | MF_EPOCH_CLOSE)
index 80fe011..85b4a48 100644 (file)
@@ -840,7 +840,7 @@ int ll_get_mdt_idx(struct inode *inode)
         if (IS_ERR(op_data))
                 RETURN(PTR_ERR(op_data));
 
-        op_data->op_valid |= OBD_MD_MDTIDX;
+       op_data->op_flags |= MF_GET_MDT_IDX;
         rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
         mdtidx = op_data->op_mds;
         ll_finish_md_op_data(op_data);
index 155d0d6..f3e3280 100644 (file)
@@ -1295,10 +1295,10 @@ static int lmv_getattr(struct obd_export *exp, struct md_op_data *op_data,
         if (IS_ERR(tgt))
                 RETURN(PTR_ERR(tgt));
 
-        if (op_data->op_valid & OBD_MD_MDTIDX) {
-                op_data->op_mds = tgt->ltd_idx;
-                RETURN(0);
-        }
+       if (op_data->op_flags & MF_GET_MDT_IDX) {
+               op_data->op_mds = tgt->ltd_idx;
+               RETURN(0);
+       }
 
         rc = md_getattr(tgt->ltd_exp, op_data, request);
         if (rc)
index 0909d64..8006b25 100644 (file)
@@ -1270,8 +1270,6 @@ void lustre_assert_wire_constants(void)
                  OBD_MD_REINT);
         LASSERTF(OBD_MD_MEA == (0x0000000400000000ULL), "found 0x%.16llxULL\n",
                  OBD_MD_MEA);
-        LASSERTF(OBD_MD_MDTIDX == (0x0000000800000000ULL), "found 0x%.16llxULL\n",
-                 OBD_MD_MDTIDX);
         LASSERTF(OBD_MD_FLXATTR == (0x0000001000000000ULL), "found 0x%.16llxULL\n",
                  OBD_MD_FLXATTR);
         LASSERTF(OBD_MD_FLXATTRLS == (0x0000002000000000ULL), "found 0x%.16llxULL\n",
index e184d47..b114274 100644 (file)
@@ -574,7 +574,6 @@ check_obdo(void)
         CHECK_DEFINE_64X(OBD_MD_MDS);
         CHECK_DEFINE_64X(OBD_MD_REINT);
         CHECK_DEFINE_64X(OBD_MD_MEA);
-        CHECK_DEFINE_64X(OBD_MD_MDTIDX);
         CHECK_DEFINE_64X(OBD_MD_FLXATTR);
         CHECK_DEFINE_64X(OBD_MD_FLXATTRLS);
         CHECK_DEFINE_64X(OBD_MD_FLXATTRRM);
index 8d139f5..a51bcc6 100644 (file)
@@ -1278,8 +1278,6 @@ void lustre_assert_wire_constants(void)
                  OBD_MD_REINT);
         LASSERTF(OBD_MD_MEA == (0x0000000400000000ULL), "found 0x%.16llxULL\n",
                  OBD_MD_MEA);
-        LASSERTF(OBD_MD_MDTIDX == (0x0000000800000000ULL), "found 0x%.16llxULL\n",
-                 OBD_MD_MDTIDX);
         LASSERTF(OBD_MD_FLXATTR == (0x0000001000000000ULL), "found 0x%.16llxULL\n",
                  OBD_MD_FLXATTR);
         LASSERTF(OBD_MD_FLXATTRLS == (0x0000002000000000ULL), "found 0x%.16llxULL\n",