From 14b98596fa2433b6c8a8cce3ee5d0ddefab5982e Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Tue, 3 Apr 2018 10:55:18 +0800 Subject: [PATCH] LU-4684 ptlrpc: add dir migration connect flag Add dir migration connect flag to prevent collision with other features. Though dir migration code exists, it will be reworked, and the new RPC protocol won't be compatible with current one. Also handle the previously-added OBD_CONNECT2_FLR flag. Test-Parameters: trivial Signed-off-by: Lai Siyao Change-Id: Ie3eaec8602664170b52e3778b76059a0899ee7b1 Reviewed-on: https://review.whamcloud.com/31914 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev --- lustre/include/uapi/linux/lustre/lustre_idl.h | 7 ++++--- lustre/obdclass/lprocfs_status.c | 8 ++++++-- lustre/ptlrpc/wiretest.c | 4 ++++ lustre/utils/wirecheck.c | 2 ++ lustre/utils/wiretest.c | 4 ++++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 357fb14..bc5a224 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -808,9 +808,10 @@ struct ptlrpc_body_v2 { #define OBD_CONNECT_OBDOPACK 0x4000000000000000ULL /* compact OUT obdo */ #define OBD_CONNECT_FLAGS2 0x8000000000000000ULL /* second flags word */ /* ocd_connect_flags2 flags */ -#define OBD_CONNECT2_FILE_SECCTX 0x1ULL /* set file security context at create */ -#define OBD_CONNECT2_LOCKAHEAD 0x2ULL /* ladvise lockahead v2 */ -#define OBD_CONNECT2_FLR 0x20ULL /* FLR support */ +#define OBD_CONNECT2_FILE_SECCTX 0x1ULL /* set file security context at create */ +#define OBD_CONNECT2_LOCKAHEAD 0x2ULL /* ladvise lockahead v2 */ +#define OBD_CONNECT2_DIR_MIGRATE 0x4ULL /* migrate striped dir */ +#define OBD_CONNECT2_FLR 0x20ULL /* FLR support */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 0c434f2..7a0003d 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -800,8 +800,12 @@ static const char *obd_connect_names[] = { "compact_obdo", "second_flags", /* flags2 names */ - "file_secctx", - "lockaheadv2", + "file_secctx", /* 0x01 */ + "lockaheadv2", /* 0x02 */ + "dir_migrate", /* 0x04 */ + "unknown", /* 0x08 */ + "unknown", /* 0x10 */ + "flr", /* 0x20 */ NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index a2f34a7..f9bbaf0 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1298,6 +1298,10 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_FILE_SECCTX); LASSERTF(OBD_CONNECT2_LOCKAHEAD == 0x2ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_LOCKAHEAD); + LASSERTF(OBD_CONNECT2_DIR_MIGRATE == 0x4ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_DIR_MIGRATE); + LASSERTF(OBD_CONNECT2_FLR == 0x20ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_FLR); 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 8a8fe99..22723db 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -587,6 +587,8 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT_FLAGS2); CHECK_DEFINE_64X(OBD_CONNECT2_FILE_SECCTX); CHECK_DEFINE_64X(OBD_CONNECT2_LOCKAHEAD); + CHECK_DEFINE_64X(OBD_CONNECT2_DIR_MIGRATE); + CHECK_DEFINE_64X(OBD_CONNECT2_FLR); 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 9a13d9aa..6972d80 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1319,6 +1319,10 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_FILE_SECCTX); LASSERTF(OBD_CONNECT2_LOCKAHEAD == 0x2ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_LOCKAHEAD); + LASSERTF(OBD_CONNECT2_DIR_MIGRATE == 0x4ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_DIR_MIGRATE); + LASSERTF(OBD_CONNECT2_FLR == 0x20ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_FLR); 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