From bc9261874c3cdd68c2bb452eac381ab98105badd Mon Sep 17 00:00:00 2001 From: Cyril Bordage Date: Mon, 26 Aug 2024 14:05:41 +0200 Subject: [PATCH] LU-16897 idl: add OBD_CONNECT2_SPARSE flag This flag indicates when a client can handle sparse reads without sending blank pages. Test-Parameters: trivial Signed-off-by: Cyril Bordage Change-Id: I5e510deaace86558990479351074ad8f47876212 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55404 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Artem Blagodarenko Reviewed-by: Oleg Drokin --- lustre/include/lustre_export.h | 5 +++++ lustre/include/uapi/linux/lustre/lustre_idl.h | 1 + lustre/ptlrpc/wiretest.c | 2 ++ lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 2 ++ 5 files changed, 11 insertions(+) diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index 7e0700b..8814a21 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -459,6 +459,11 @@ static inline int exp_connect_encrypt(struct obd_export *exp) return !!(exp_connect_flags2(exp) & OBD_CONNECT2_ENCRYPT); } +static inline int exp_connect_sparse(struct obd_export *exp) +{ + return !!(exp_connect_flags2(exp) & OBD_CONNECT2_SPARSE); +} + static inline int exp_connect_encrypt_fid2path(struct obd_export *exp) { return !!(exp_connect_flags2(exp) & OBD_CONNECT2_ENCRYPT_FID2PATH); diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index f1c9f38..7a30435 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -845,6 +845,7 @@ struct ptlrpc_body_v2 { */ #define OBD_CONNECT2_UNALIGNED_DIO 0x400000000ULL /* unaligned DIO */ #define OBD_CONNECT2_CONN_POLICY 0x800000000ULL /* server-side connection policy */ +#define OBD_CONNECT2_SPARSE 0x1000000000ULL /* sparse LNet read */ #define OBD_CONNECT2_MIRROR_ID_FIX 0x2000000000ULL /* rr_mirror_id move */ #define OBD_CONNECT2_UPDATE_LAYOUT 0x4000000000ULL /* update compressibility */ /* XXX README XXX README XXX README XXX README XXX README XXX README XXX diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 96ca9af..cfbed5a 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1467,6 +1467,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_UNALIGNED_DIO); LASSERTF(OBD_CONNECT2_CONN_POLICY == 0x800000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_CONN_POLICY); + LASSERTF(OBD_CONNECT2_SPARSE == 0x1000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_SPARSE); LASSERTF(OBD_CONNECT2_MIRROR_ID_FIX == 0x2000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_MIRROR_ID_FIX); LASSERTF(OBD_CONNECT2_UPDATE_LAYOUT == 0x4000000000ULL, "found 0x%.16llxULL\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index e5a5e37..9661947 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -703,6 +703,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT2_COMPRESS); CHECK_DEFINE_64X(OBD_CONNECT2_UNALIGNED_DIO); CHECK_DEFINE_64X(OBD_CONNECT2_CONN_POLICY); + CHECK_DEFINE_64X(OBD_CONNECT2_SPARSE); CHECK_DEFINE_64X(OBD_CONNECT2_MIRROR_ID_FIX); CHECK_DEFINE_64X(OBD_CONNECT2_UPDATE_LAYOUT); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 846b0f2..cc51138 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1492,6 +1492,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_UNALIGNED_DIO); LASSERTF(OBD_CONNECT2_CONN_POLICY == 0x800000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_CONN_POLICY); + LASSERTF(OBD_CONNECT2_SPARSE == 0x1000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_SPARSE); LASSERTF(OBD_CONNECT2_MIRROR_ID_FIX == 0x2000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_MIRROR_ID_FIX); LASSERTF(OBD_CONNECT2_UPDATE_LAYOUT == 0x4000000000ULL, "found 0x%.16llxULL\n", -- 1.8.3.1