From: wangdi Date: Thu, 26 Jul 2012 12:47:25 +0000 (-0700) Subject: LU-1681 llite: remove unnecessary OBD_MD_MDTIDX X-Git-Tag: 2.3.57~13 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2b829430008ff1996bdf186d5f87b4cca785fe8b LU-1681 llite: remove unnecessary OBD_MD_MDTIDX Remove unnecessary OBD_MD_MDTIDX to save bits for OBD_MD_XXX. Signed-off-by: Wang Di Change-Id: I80e4abdf861605e09879e6bc1d7c3da0ef06ad66 Reviewed-on: http://review.whamcloud.com/3481 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Fan Yong --- diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index a097158..394decc 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -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) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 80fe011..85b4a48 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -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); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 155d0d6..f3e3280 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -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) diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 0909d64..8006b25 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -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", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index e184d47..b114274 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -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); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 8d139f5..a51bcc6 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -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",