From a145fabe132bd498343ba854d4b30044487e8e31 Mon Sep 17 00:00:00 2001 From: Wang Di Date: Sat, 21 Jun 2014 00:59:25 -0700 Subject: [PATCH] LU-4843 mdt: Add OBD_CONNECT_DIR_STRIPE flag Add OBD_CONNECT_DIR_STRIPE to tell if the client supports striped dir, so only new client (>= 2.6) can access striped directory. Change-Id: I5d5f1a6a9f5efdce0c6fe22106a8853cd78bb486 Signed-off-by: Wang Di Reviewed-on: http://review.whamcloud.com/10773 Reviewed-by: Andreas Dilger Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Bob Glossman --- lustre/include/lustre/lustre_idl.h | 4 +++- lustre/llite/llite_lib.c | 3 ++- lustre/mdt/mdt_internal.h | 4 +--- lustre/obdclass/lprocfs_status.c | 2 ++ lustre/ptlrpc/wiretest.c | 2 ++ lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 2 ++ 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 6f21697..f790fa1 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -1350,6 +1350,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); name in request */ #define OBD_CONNECT_LFSCK 0x40000000000000ULL/* support online LFSCK */ #define OBD_CONNECT_UNLINK_CLOSE 0x100000000000000ULL/* close file in unlink */ +#define OBD_CONNECT_DIR_STRIPE 0x400000000000000ULL /* striped DNE dir */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same @@ -1395,7 +1396,8 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); OBD_CONNECT_PINGLESS | OBD_CONNECT_MAX_EASIZE |\ OBD_CONNECT_FLOCK_DEAD | \ OBD_CONNECT_DISP_STRIPE | OBD_CONNECT_LFSCK | \ - OBD_CONNECT_OPEN_BY_FID) + OBD_CONNECT_OPEN_BY_FID | \ + OBD_CONNECT_DIR_STRIPE) #define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \ OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \ diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 76e0f3b..8a43a1f 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -214,7 +214,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, OBD_CONNECT_MAX_EASIZE | OBD_CONNECT_FLOCK_DEAD | OBD_CONNECT_DISP_STRIPE | OBD_CONNECT_LFSCK | - OBD_CONNECT_OPEN_BY_FID; + OBD_CONNECT_OPEN_BY_FID | + OBD_CONNECT_DIR_STRIPE; if (sbi->ll_flags & LL_SBI_SOM_PREVIEW) data->ocd_connect_flags |= OBD_CONNECT_SOM; diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index dbfb7c5..9017957d 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -594,11 +594,9 @@ static inline bool mdt_is_dne_client(struct obd_export *exp) return !!(exp_connect_flags(exp) & OBD_CONNECT_LVB_TYPE); } -/* Here we use OBD_CONNECT_DISP_STRIPE to check the client who support - * striped directory, because it is also landed on 2.6 */ static inline bool mdt_is_striped_client(struct obd_export *exp) { - return exp_connect_flags(exp) & OBD_CONNECT_DISP_STRIPE; + return exp_connect_flags(exp) & OBD_CONNECT_DIR_STRIPE; } int mdt_get_disposition(struct ldlm_reply *rep, int flag); diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 885b4d4..f18b4dc 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -901,6 +901,8 @@ static const char *obd_connect_names[] = { "unknown", "unlink_close", "unknown", + "dir_stripe", + "unknown", NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 25c8e60..c6114e6 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1180,6 +1180,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT_LFSCK); LASSERTF(OBD_CONNECT_UNLINK_CLOSE == 0x100000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_UNLINK_CLOSE); + LASSERTF(OBD_CONNECT_DIR_STRIPE == 0x400000000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_DIR_STRIPE); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index cd9c821..416f8fe 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -526,6 +526,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT_OPEN_BY_FID); CHECK_DEFINE_64X(OBD_CONNECT_LFSCK); CHECK_DEFINE_64X(OBD_CONNECT_UNLINK_CLOSE); + CHECK_DEFINE_64X(OBD_CONNECT_DIR_STRIPE); CHECK_VALUE_X(OBD_CKSUM_CRC32); CHECK_VALUE_X(OBD_CKSUM_ADLER); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index e2251be..55ec116 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1186,6 +1186,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT_LFSCK); LASSERTF(OBD_CONNECT_UNLINK_CLOSE == 0x100000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_UNLINK_CLOSE); + LASSERTF(OBD_CONNECT_DIR_STRIPE == 0x400000000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_DIR_STRIPE); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", -- 1.8.3.1