Whamcloud - gitweb
LU-15714 pcc: reserve layout intent flags for PCCRO 81/46981/10
authorQian Yingjin <qian@ddn.com>
Sat, 2 Apr 2022 09:26:29 +0000 (05:26 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 2 Apr 2024 20:59:16 +0000 (20:59 +0000)
Add wirecheck checks for PCCRO data structures
struct lu_pcc_attach,  lu_pcc_detach, lu_pcc_state

Test-Parameters: trivial
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: If8a414103ab13155aa483179247c81908b6ced69
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/46981
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Feng Lei <flei@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 5cafbf3..774c1e0 100644 (file)
@@ -7008,4 +7008,60 @@ void lustre_assert_wire_constants(void)
                 (long long)PORTALS_CFG_TYPE);
        LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n",
                 (long long)LUSTRE_CFG_TYPE);
+
+       /* Checks for struct lu_pcc_attach */
+       LASSERTF((int)sizeof(struct lu_pcc_attach) == 8, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_attach));
+       LASSERTF((int)offsetof(struct lu_pcc_attach, pcca_type) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_attach, pcca_type));
+       LASSERTF((int)sizeof(((struct lu_pcc_attach *)0)->pcca_type) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_attach *)0)->pcca_type));
+       LASSERTF((int)offsetof(struct lu_pcc_attach, pcca_id) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_attach, pcca_id));
+       LASSERTF((int)sizeof(((struct lu_pcc_attach *)0)->pcca_id) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_attach *)0)->pcca_id));
+
+       /* Checks for struct lu_pcc_detach */
+       LASSERTF((int)sizeof(struct lu_pcc_detach) == 4, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_detach));
+       LASSERTF((int)offsetof(struct lu_pcc_detach, pccd_opt) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_detach, pccd_opt));
+       LASSERTF((int)sizeof(((struct lu_pcc_detach *)0)->pccd_opt) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_detach *)0)->pccd_opt));
+
+       /* Checks for struct lu_pcc_detach_fid */
+       LASSERTF((int)sizeof(struct lu_pcc_detach_fid) == 20, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_detach_fid));
+       LASSERTF((int)offsetof(struct lu_pcc_detach_fid, pccd_fid) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_detach_fid, pccd_fid));
+       LASSERTF((int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_fid) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_fid));
+       LASSERTF((int)offsetof(struct lu_pcc_detach_fid, pccd_opt) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_detach_fid, pccd_opt));
+       LASSERTF((int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_opt) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_opt));
+
+       /* Checks for struct lu_pcc_state */
+       LASSERTF((int)sizeof(struct lu_pcc_state) == 4112, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_state));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_type) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_type));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_type) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_type));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_open_count) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_open_count));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_open_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_open_count));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_flags) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_flags));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_flags));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_padding) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_padding));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_padding) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_padding));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_path) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_path));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_path) == 4096, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_path));
 }
index 6c6b62c..da7bac0 100644 (file)
@@ -3284,6 +3284,40 @@ check_lustre_cfg(void)
        CHECK_VALUE(LUSTRE_CFG_TYPE);
 }
 
+static void check_lu_pcc_attach(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(lu_pcc_attach);
+       CHECK_MEMBER(lu_pcc_attach, pcca_type);
+       CHECK_MEMBER(lu_pcc_attach, pcca_id);
+}
+
+static void check_lu_pcc_detach(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(lu_pcc_detach);
+       CHECK_MEMBER(lu_pcc_detach, pccd_opt);
+}
+
+static void check_lu_pcc_detach_fid(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(lu_pcc_detach_fid);
+       CHECK_MEMBER(lu_pcc_detach_fid, pccd_fid);
+       CHECK_MEMBER(lu_pcc_detach_fid, pccd_opt);
+}
+
+static void check_lu_pcc_state(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(lu_pcc_state);
+       CHECK_MEMBER(lu_pcc_state, pccs_type);
+       CHECK_MEMBER(lu_pcc_state, pccs_open_count);
+       CHECK_MEMBER(lu_pcc_state, pccs_flags);
+       CHECK_MEMBER(lu_pcc_state, pccs_padding);
+       CHECK_MEMBER(lu_pcc_state, pccs_path);
+}
+
 int
 main(int argc, char **argv)
 {
@@ -3715,6 +3749,11 @@ main(int argc, char **argv)
 #endif /* !HAVE_NATIVE_LINUX_CLIENT */
        check_lustre_cfg();
 
+       check_lu_pcc_attach();
+       check_lu_pcc_detach();
+       check_lu_pcc_detach_fid();
+       check_lu_pcc_state();
+
        printf("}\n");
 
        return 0;
index c320e4b..75543bc 100644 (file)
@@ -1657,7 +1657,7 @@ void lustre_assert_wire_constants(void)
                 OBD_MD_FLGID);
        LASSERTF(OBD_MD_FLFLAGS == (0x00000800ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLFLAGS);
-       LASSERTF(OBD_MD_DOM_SIZE == (0x00001000ULL), "found 0x%.16llxULL\n",
+       LASSERTF(OBD_MD_DOM_SIZE == (0X00001000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_DOM_SIZE);
        LASSERTF(OBD_MD_FLNLINK == (0x00002000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLNLINK);
@@ -7033,4 +7033,60 @@ void lustre_assert_wire_constants(void)
                 (long long)PORTALS_CFG_TYPE);
        LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n",
                 (long long)LUSTRE_CFG_TYPE);
+
+       /* Checks for struct lu_pcc_attach */
+       LASSERTF((int)sizeof(struct lu_pcc_attach) == 8, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_attach));
+       LASSERTF((int)offsetof(struct lu_pcc_attach, pcca_type) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_attach, pcca_type));
+       LASSERTF((int)sizeof(((struct lu_pcc_attach *)0)->pcca_type) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_attach *)0)->pcca_type));
+       LASSERTF((int)offsetof(struct lu_pcc_attach, pcca_id) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_attach, pcca_id));
+       LASSERTF((int)sizeof(((struct lu_pcc_attach *)0)->pcca_id) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_attach *)0)->pcca_id));
+
+       /* Checks for struct lu_pcc_detach */
+       LASSERTF((int)sizeof(struct lu_pcc_detach) == 4, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_detach));
+       LASSERTF((int)offsetof(struct lu_pcc_detach, pccd_opt) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_detach, pccd_opt));
+       LASSERTF((int)sizeof(((struct lu_pcc_detach *)0)->pccd_opt) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_detach *)0)->pccd_opt));
+
+       /* Checks for struct lu_pcc_detach_fid */
+       LASSERTF((int)sizeof(struct lu_pcc_detach_fid) == 20, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_detach_fid));
+       LASSERTF((int)offsetof(struct lu_pcc_detach_fid, pccd_fid) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_detach_fid, pccd_fid));
+       LASSERTF((int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_fid) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_fid));
+       LASSERTF((int)offsetof(struct lu_pcc_detach_fid, pccd_opt) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_detach_fid, pccd_opt));
+       LASSERTF((int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_opt) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_detach_fid *)0)->pccd_opt));
+
+       /* Checks for struct lu_pcc_state */
+       LASSERTF((int)sizeof(struct lu_pcc_state) == 4112, "found %lld\n",
+                (long long)(int)sizeof(struct lu_pcc_state));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_type) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_type));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_type) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_type));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_open_count) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_open_count));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_open_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_open_count));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_flags) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_flags));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_flags));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_padding) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_padding));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_padding) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_padding));
+       LASSERTF((int)offsetof(struct lu_pcc_state, pccs_path) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct lu_pcc_state, pccs_path));
+       LASSERTF((int)sizeof(((struct lu_pcc_state *)0)->pccs_path) == 4096, "found %lld\n",
+                (long long)(int)sizeof(((struct lu_pcc_state *)0)->pccs_path));
 }