Whamcloud - gitweb
EX-7775 utils: fix LL_COMPR_TYPE wire checks
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 27 Jun 2023 14:42:20 +0000 (16:42 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 1 Jul 2023 10:01:42 +0000 (10:01 +0000)
Fix LL_COMPR_TYPE* wire checks to avoid duplication.
The value of LL_COMPR_TYPE_UNCHANGED is also declared as 15 so that
is does not conflict with other potential real compression types in
the future.

Fixes: 67d4601737 ("EX-6249 csdc: set compress component for file")
Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iab9830f09f0778e1e1f3b1ea4c9878ce1017de8d
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51473
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 77057cb..d630e80 100644 (file)
@@ -2931,7 +2931,7 @@ enum ll_compr_type {
        LL_COMPR_TYPE_LZ4HC     = 5,
        LL_COMPR_TYPE_LZO       = 6,
        LL_COMPR_TYPE_MAX,
-       LL_COMPR_TYPE_UNCHANGED
+       LL_COMPR_TYPE_UNCHANGED = 15
 };
 
 #define COMPR_CHUNK_MIN_BITS 16
index b5b8c3f..7e642bc 100644 (file)
@@ -6354,20 +6354,4 @@ void lustre_assert_wire_constants(void)
                 (long long)PORTALS_CFG_TYPE);
        LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n",
                 (long long)LUSTRE_CFG_TYPE);
-       LASSERTF(LL_COMPR_TYPE_NONE == 0, "found %lld\n",
-                (long long)LL_COMPR_TYPE_NONE);
-       LASSERTF(LL_COMPR_TYPE_FAST == 1, "found %lld\n",
-                (long long)LL_COMPR_TYPE_FAST);
-       LASSERTF(LL_COMPR_TYPE_BEST == 2, "found %lld\n",
-                (long long)LL_COMPR_TYPE_BEST);
-       LASSERTF(LL_COMPR_TYPE_GZIP == 3, "found %lld\n",
-                (long long)LL_COMPR_TYPE_GZIP);
-       LASSERTF(LL_COMPR_TYPE_LZ4FAST == 4, "found %lld\n",
-                (long long)LL_COMPR_TYPE_LZ4FAST);
-       LASSERTF(LL_COMPR_TYPE_LZ4HC == 5, "found %lld\n",
-                (long long)LL_COMPR_TYPE_LZ4HC);
-       LASSERTF(LL_COMPR_TYPE_LZO == 6, "found %lld\n",
-                (long long)LL_COMPR_TYPE_LZO);
-       LASSERTF(LL_COMPR_TYPE_MAX == 7, "found %lld\n",
-                (long long)LL_COMPR_TYPE_MAX);
 }
index 30af5c6..4f323b6 100644 (file)
@@ -2998,19 +2998,6 @@ check_lustre_cfg(void)
        CHECK_VALUE(LUSTRE_CFG_TYPE);
 }
 
-static void
-check_ll_compr_type()
-{
-       CHECK_VALUE(LL_COMPR_TYPE_NONE);
-       CHECK_VALUE(LL_COMPR_TYPE_FAST);
-       CHECK_VALUE(LL_COMPR_TYPE_BEST);
-       CHECK_VALUE(LL_COMPR_TYPE_GZIP);
-       CHECK_VALUE(LL_COMPR_TYPE_LZ4);
-       CHECK_VALUE(LL_COMPR_TYPE_LZ4HC);
-       CHECK_VALUE(LL_COMPR_TYPE_LZO);
-       CHECK_VALUE(LL_COMPR_TYPE_MAX);
-}
-
 int
 main(int argc, char **argv)
 {
@@ -3418,8 +3405,6 @@ main(int argc, char **argv)
 #endif /* !HAVE_NATIVE_LINUX_CLIENT */
        check_lustre_cfg();
 
-       check_ll_compr_type();
-
        printf("}\n");
 
        return 0;
index d0b9154..dff601c 100644 (file)
@@ -6389,20 +6389,4 @@ void lustre_assert_wire_constants(void)
                 (long long)PORTALS_CFG_TYPE);
        LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n",
                 (long long)LUSTRE_CFG_TYPE);
-       LASSERTF(LL_COMPR_TYPE_NONE == 0, "found %lld\n",
-                (long long)LL_COMPR_TYPE_NONE);
-       LASSERTF(LL_COMPR_TYPE_FAST == 1, "found %lld\n",
-                (long long)LL_COMPR_TYPE_FAST);
-       LASSERTF(LL_COMPR_TYPE_BEST == 2, "found %lld\n",
-                (long long)LL_COMPR_TYPE_BEST);
-       LASSERTF(LL_COMPR_TYPE_GZIP == 3, "found %lld\n",
-                (long long)LL_COMPR_TYPE_GZIP);
-       LASSERTF(LL_COMPR_TYPE_LZ4FAST == 4, "found %lld\n",
-                (long long)LL_COMPR_TYPE_LZ4FAST);
-       LASSERTF(LL_COMPR_TYPE_LZ4HC == 5, "found %lld\n",
-                (long long)LL_COMPR_TYPE_LZ4HC);
-       LASSERTF(LL_COMPR_TYPE_LZO == 6, "found %lld\n",
-                (long long)LL_COMPR_TYPE_LZO);
-       LASSERTF(LL_COMPR_TYPE_MAX == 7, "found %lld\n",
-                (long long)LL_COMPR_TYPE_MAX);
 }