From 14ee65e77bdcf390568f81fad7505048f69bebe9 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Sat, 23 Mar 2019 02:45:34 +0800 Subject: [PATCH] LU-11213 uapi: reserve connect flag for plain layout Reserve OBD_CONNECT2_PLAIN_LAYOUT flag, so that client supporting plain layout won't enable plain layout if MDT doesn't support, and in contrary, MDT supporting plain layout won't send such layout to client that doesn't support. Signed-off-by: Lai Siyao Change-Id: Ia629e17d83b5b48c94518de428e5abd79e5a37f0 Reviewed-on: https://review.whamcloud.com/34656 Reviewed-by: Andreas Dilger Reviewed-by: Patrick Farrell Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/include/uapi/linux/lustre/lustre_idl.h | 1 + lustre/obdclass/lprocfs_status.c | 1 + lustre/ptlrpc/wiretest.c | 2 ++ lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 2 ++ 5 files changed, 7 insertions(+) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index a913214..08e9531 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -836,6 +836,7 @@ struct ptlrpc_body_v2 { #define OBD_CONNECT2_SELINUX_POLICY 0x400ULL /* has client SELinux policy */ #define OBD_CONNECT2_LSOM 0x800ULL /* LSOM support */ #define OBD_CONNECT2_PCC 0x1000ULL /* Persistent Client Cache */ +#define OBD_CONNECT2_PLAIN_LAYOUT 0x2000ULL /* Plain Directory Layout */ /* 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 dbbf136..2ea931e 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -786,6 +786,7 @@ static const char *obd_connect_names[] = { "selinux_policy", /* 0x400 */ "lsom", /* 0x800 */ "pcc", /* 0x1000 */ + "plain_layout", /* 0x2000 */ NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index b3fbc19..c4fa761 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1342,6 +1342,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_LSOM); LASSERTF(OBD_CONNECT2_PCC == 0x1000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_PCC); + LASSERTF(OBD_CONNECT2_PLAIN_LAYOUT == 0x2000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_PLAIN_LAYOUT); 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 850d5d7..0fd443d 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -608,6 +608,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT2_SELINUX_POLICY); CHECK_DEFINE_64X(OBD_CONNECT2_LSOM); CHECK_DEFINE_64X(OBD_CONNECT2_PCC); + CHECK_DEFINE_64X(OBD_CONNECT2_PLAIN_LAYOUT); 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 8e61601..d220aa1 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1364,6 +1364,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_LSOM); LASSERTF(OBD_CONNECT2_PCC == 0x1000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_PCC); + LASSERTF(OBD_CONNECT2_PLAIN_LAYOUT == 0x2000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_PLAIN_LAYOUT); 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