From: James Simmons Date: Tue, 22 Apr 2025 19:47:14 +0000 (-0400) Subject: LU-10911 idl: add OBD_CONNECT2_FLR_EC flag X-Git-Tag: 2.16.55~33 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=74c1853a4f4b8a6efd5d62bbca38e0e6bad3f664;p=fs%2Flustre-release.git LU-10911 idl: add OBD_CONNECT2_FLR_EC flag The new connect2 flag indicates when I/O data containing parity data can be handled. The field l_ost_gen for struct lov_ost_data_v1 has never been used. We can use it to classify OST object data. Test-Parameters: trivial Change-Id: I4883c7f5bb80690de7b3fe65144baa70538bd4d6 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58843 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index afdc282..630ef5e 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -456,6 +456,11 @@ static inline int exp_connect_flr(struct obd_export *exp) return !!(exp_connect_flags2(exp) & OBD_CONNECT2_FLR); } +static inline int exp_connect_parity(struct obd_export *exp) +{ + return !!(exp_connect_flags2(exp) & OBD_CONNECT2_FLR_EC); +} + static inline int exp_connect_lock_convert(struct obd_export *exp) { return !!(exp_connect_flags2(exp) & OBD_CONNECT2_LOCK_CONVERT); diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index a686c44..cc59756 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -850,7 +850,7 @@ struct ptlrpc_body_v2 { #define OBD_CONNECT2_MIRROR_ID_FIX 0x2000000000ULL /* rr_mirror_id move */ #define OBD_CONNECT2_UPDATE_LAYOUT 0x4000000000ULL /* update compressibility */ #define OBD_CONNECT2_READDIR_OPEN 0x8000000000ULL /* read first dir page on open */ - +#define OBD_CONNECT2_FLR_EC 0x10000000000ULL /* parity support */ /* XXX README XXX README XXX README XXX README XXX README XXX README XXX * Please DO NOT add OBD_CONNECT flags before first ensuring that this value * is not in use by some other branch/patch. Email adilger@whamcloud.com @@ -1232,7 +1232,10 @@ enum obdo_flags { #define lov_ost_data lov_ost_data_v1 struct lov_ost_data_v1 { /* per-stripe data structure (little-endian)*/ struct ost_id l_ost_oi; /* OST object ID */ - __u32 l_ost_gen; /* generation of this l_ost_idx */ + union { + __u32 l_ost_type; /* type of data stored in OST object */ + __u32 l_ost_gen; /* generation of this l_ost_idx */ + }; __u32 l_ost_idx; /* OST index in LOV (lov_tgt_desc->tgts) */ }; diff --git a/lustre/include/uapi/linux/lustre/lustre_user.h b/lustre/include/uapi/linux/lustre/lustre_user.h index 0f4595a..8215779 100644 --- a/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/lustre/include/uapi/linux/lustre/lustre_user.h @@ -886,7 +886,10 @@ static inline bool lov_pool_is_reserved(const char *pool) #define lov_user_ost_data lov_user_ost_data_v1 struct lov_user_ost_data_v1 { /* per-stripe data structure */ struct ost_id l_ost_oi; /* OST object ID */ - __u32 l_ost_gen; /* generation of this OST index */ + union { + __u32 l_ost_type; /* type of data stored in OST object */ + __u32 l_ost_gen; /* generation of this OST index */ + }; __u32 l_ost_idx; /* OST index in LOV */ } __attribute__((packed)); diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 7370153..1a00a5e 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -728,6 +728,7 @@ static const char *const obd_connect_names[] = { "mirror_id_fix", /* 0x2000000000 */ "update_layout", /* 0x4000000000 */ "readdir_open", /* 0x8000000000 */ + "flr_ec", /* 0x1000000000 */ NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 1b9e885..02668ee 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1455,6 +1455,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_MIRROR_ID_FIX); LASSERTF(OBD_CONNECT2_UPDATE_LAYOUT == 0x4000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_UPDATE_LAYOUT); + LASSERTF(OBD_CONNECT2_FLR_EC == 0x10000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_FLR_EC); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 14a594e..1851355 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -706,6 +706,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT2_SPARSE); CHECK_DEFINE_64X(OBD_CONNECT2_MIRROR_ID_FIX); CHECK_DEFINE_64X(OBD_CONNECT2_UPDATE_LAYOUT); + CHECK_DEFINE_64X(OBD_CONNECT2_FLR_EC); BLANK_LINE(); CHECK_VALUE_X(OBD_CKSUM_CRC32); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 18881a2..bc4a232 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1500,6 +1500,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_MIRROR_ID_FIX); LASSERTF(OBD_CONNECT2_UPDATE_LAYOUT == 0x4000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_UPDATE_LAYOUT); + LASSERTF(OBD_CONNECT2_FLR_EC == 0x10000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_FLR_EC); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32);