Whamcloud - gitweb
LU-16837 csdc: reserve connect bits for compressed layout 08/51108/5
authorBobi Jam <bobijam@whamcloud.com>
Wed, 24 May 2023 00:25:05 +0000 (08:25 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 20 Jun 2023 03:37:09 +0000 (03:37 +0000)
Add connect data bit for compressed layout (OBD_CONNECT2_COMPRESS)
and another connect data bit to be used (OBD_CONNECT2_LARGE_NID).

Also reserve obd_connect_data::ocd_compr_type which is a bitmask of
supported compression type to be negotiated between client and MDS.

Test-Parameters: trivial
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I21029c6c3e8a7e690ecc8d489bbb95aec3ab1fa8
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51108
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/obdclass/lprocfs_status.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index e2e18b9..9064639 100644 (file)
@@ -848,6 +848,8 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT2_ENCRYPT_FID2PATH   0x40000000ULL /* fid2path enc file */
 /* For MDS+OSS rolling upgrade interop with 2.16+older, ignored after 2.20.53 */
 #define OBD_CONNECT2_REPLAY_CREATE      0x80000000ULL /* replay OST_CREATE */
+#define OBD_CONNECT2_LARGE_NID         0x100000000ULL /* understands large/IPv6 NIDs */
+#define OBD_CONNECT2_COMPRESS          0x200000000ULL /* compressed file */
 /* 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
@@ -987,7 +989,7 @@ struct obd_connect_data {
        __u16 padding0;          /* READ BELOW! also fix lustre_swab_connect */
        __u32 padding1;          /* READ BELOW! also fix lustre_swab_connect */
        __u64 ocd_connect_flags2;/* OBD_CONNECT2_* per above */
-       __u64 padding3;          /* READ BELOW! also fix lustre_swab_connect */
+       __u64 ocd_compr_type;    /* bitmask of supported compression types */
        __u64 padding4;          /* READ BELOW! also fix lustre_swab_connect */
        __u64 padding5;          /* READ BELOW! also fix lustre_swab_connect */
        __u64 padding6;          /* READ BELOW! also fix lustre_swab_connect */
index d552488..fa55f70 100644 (file)
@@ -652,6 +652,8 @@ static const char *const obd_connect_names[] = {
        "dmv_imp_inherit",              /* 0x20000000 */
        "encryption_fid2path",          /* 0x40000000 */
        "replay_create",                /* 0x80000000 */
+       "large_nid",                    /* 0x100000000 */
+       "compressed_file",              /* 0x200000000 */
        NULL
 };
 
index 40fe614..8e37ca4 100644 (file)
@@ -1842,9 +1842,11 @@ void lustre_swab_connect(struct obd_connect_data *ocd)
                __swab16s(&ocd->ocd_maxmodrpcs);
        BUILD_BUG_ON(offsetof(typeof(*ocd), padding0) == 0);
        BUILD_BUG_ON(offsetof(typeof(*ocd), padding1) == 0);
-       if (ocd->ocd_connect_flags & OBD_CONNECT_FLAGS2)
+       if (ocd->ocd_connect_flags & OBD_CONNECT_FLAGS2) {
                __swab64s(&ocd->ocd_connect_flags2);
-       BUILD_BUG_ON(offsetof(typeof(*ocd), padding3) == 0);
+               if (ocd->ocd_connect_flags2 & OBD_CONNECT2_COMPRESS)
+                       __swab64s(&ocd->ocd_compr_type);
+       }
        BUILD_BUG_ON(offsetof(typeof(*ocd), padding4) == 0);
        BUILD_BUG_ON(offsetof(typeof(*ocd), padding5) == 0);
        BUILD_BUG_ON(offsetof(typeof(*ocd), padding6) == 0);
index 58e0610..da714f0 100644 (file)
@@ -1213,10 +1213,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct obd_connect_data, ocd_connect_flags2));
        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_connect_flags2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_connect_flags2));
-       LASSERTF((int)offsetof(struct obd_connect_data, padding3) == 88, "found %lld\n",
-                (long long)(int)offsetof(struct obd_connect_data, padding3));
-       LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding3) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obd_connect_data *)0)->padding3));
+       LASSERTF((int)offsetof(struct obd_connect_data, ocd_compr_type) == 88, "found %lld\n",
+                (long long)(int)offsetof(struct obd_connect_data, ocd_compr_type));
+       LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_compr_type) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_compr_type));
        LASSERTF((int)offsetof(struct obd_connect_data, padding4) == 96, "found %lld\n",
                 (long long)(int)offsetof(struct obd_connect_data, padding4));
        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding4) == 8, "found %lld\n",
@@ -1447,6 +1447,10 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_ENCRYPT_FID2PATH);
        LASSERTF(OBD_CONNECT2_REPLAY_CREATE == 0x80000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_REPLAY_CREATE);
+       LASSERTF(OBD_CONNECT2_LARGE_NID == 0x100000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_LARGE_NID);
+       LASSERTF(OBD_CONNECT2_COMPRESS == 0x200000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_COMPRESS);
 
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);
index cb26884..dcdfd0f 100644 (file)
@@ -577,7 +577,7 @@ check_obd_connect_data(void)
        CHECK_MEMBER(obd_connect_data, padding0);
        CHECK_MEMBER(obd_connect_data, padding1);
        CHECK_MEMBER(obd_connect_data, ocd_connect_flags2);
-       CHECK_MEMBER(obd_connect_data, padding3);
+       CHECK_MEMBER(obd_connect_data, ocd_compr_type);
        CHECK_MEMBER(obd_connect_data, padding4);
        CHECK_MEMBER(obd_connect_data, padding5);
        CHECK_MEMBER(obd_connect_data, padding6);
@@ -683,6 +683,8 @@ check_obd_connect_data(void)
        CHECK_DEFINE_64X(OBD_CONNECT2_DMV_IMP_INHERIT);
        CHECK_DEFINE_64X(OBD_CONNECT2_ENCRYPT_FID2PATH);
        CHECK_DEFINE_64X(OBD_CONNECT2_REPLAY_CREATE);
+       CHECK_DEFINE_64X(OBD_CONNECT2_LARGE_NID);
+       CHECK_DEFINE_64X(OBD_CONNECT2_COMPRESS);
 
        BLANK_LINE();
        CHECK_VALUE_X(OBD_CKSUM_CRC32);
index 7dfedcc..0fea530 100644 (file)
@@ -1239,10 +1239,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct obd_connect_data, ocd_connect_flags2));
        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_connect_flags2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_connect_flags2));
-       LASSERTF((int)offsetof(struct obd_connect_data, padding3) == 88, "found %lld\n",
-                (long long)(int)offsetof(struct obd_connect_data, padding3));
-       LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding3) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obd_connect_data *)0)->padding3));
+       LASSERTF((int)offsetof(struct obd_connect_data, ocd_compr_type) == 88, "found %lld\n",
+                (long long)(int)offsetof(struct obd_connect_data, ocd_compr_type));
+       LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_compr_type) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_compr_type));
        LASSERTF((int)offsetof(struct obd_connect_data, padding4) == 96, "found %lld\n",
                 (long long)(int)offsetof(struct obd_connect_data, padding4));
        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding4) == 8, "found %lld\n",
@@ -1472,6 +1472,10 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_ENCRYPT_FID2PATH);
        LASSERTF(OBD_CONNECT2_REPLAY_CREATE == 0x80000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_REPLAY_CREATE);
+       LASSERTF(OBD_CONNECT2_LARGE_NID == 0x100000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_LARGE_NID);
+       LASSERTF(OBD_CONNECT2_COMPRESS == 0x200000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_COMPRESS);
 
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);