From dbafa9df0f8f72ff8849af9066eac46a2c980e9f Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Sat, 7 Sep 2019 20:22:29 +0800 Subject: [PATCH] LU-11025 uapi: introduce OBD_CONNECT2_CRUSH Introduce a new connect flag OBD_CONNECT2_CRUSH to indicate whether client or server supports new directory hash type 'crush'. Test-parameters: trivial Signed-off-by: Lai Siyao Change-Id: I073ab65eddf502c016f30ad535740f3d9a77459f Reviewed-on: https://review.whamcloud.com/36774 Reviewed-by: Andreas Dilger Reviewed-by: Olaf Faaland-LLNL Tested-by: jenkins Tested-by: Maloo --- lustre/include/uapi/linux/lustre/lustre_idl.h | 1 + lustre/obdclass/lprocfs_status.c | 2 +- lustre/ptlrpc/wiretest.c | 2 ++ lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 2 ++ 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index db941b2..5b02ad3 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -838,6 +838,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_CRUSH 0x2000ULL /* crush hash striped directory */ #define OBD_CONNECT2_ASYNC_DISCARD 0x4000ULL /* support async DoM data discard */ #define OBD_CONNECT2_ENCRYPT 0x8000ULL /* client-to-disk encrypt */ /* XXX README XXX: diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 9d6c8c2..d9154dc 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -784,7 +784,7 @@ static const char *obd_connect_names[] = { "selinux_policy", /* 0x400 */ "lsom", /* 0x800 */ "pcc", /* 0x1000 */ - "plain_layout", /* 0x2000 */ + "crush", /* 0x2000 */ "async_discard", /* 0x4000 */ "client_encryption", /* 0x8000 */ NULL diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index aa40cf6..b6f561d 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1351,6 +1351,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_CRUSH == 0x2000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_CRUSH); LASSERTF(OBD_CONNECT2_ASYNC_DISCARD == 0x4000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_ASYNC_DISCARD); LASSERTF(OBD_CONNECT2_ENCRYPT == 0x8000ULL, "found 0x%.16llxULL\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 6696a5b..e252ecd 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -612,6 +612,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_CRUSH); CHECK_DEFINE_64X(OBD_CONNECT2_ASYNC_DISCARD); CHECK_DEFINE_64X(OBD_CONNECT2_ENCRYPT); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 7f5967b..4940411 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1381,6 +1381,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_CRUSH == 0x2000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_CRUSH); LASSERTF(OBD_CONNECT2_ASYNC_DISCARD == 0x4000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_ASYNC_DISCARD); LASSERTF(OBD_CONNECT2_ENCRYPT == 0x8000ULL, "found 0x%.16llxULL\n", -- 1.8.3.1