Whamcloud - gitweb
LU-17784 build: improve wiretest for flexible arrays
[fs/lustre-release.git] / lustre / ptlrpc / wiretest.c
index 8ed8574..c85dc3b 100644 (file)
@@ -2019,10 +2019,11 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct lov_comp_md_v1, lcm_padding2));
        LASSERTF((int)sizeof(((struct lov_comp_md_v1 *)0)->lcm_padding2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct lov_comp_md_v1 *)0)->lcm_padding2));
-       LASSERTF((int)offsetof(struct lov_comp_md_v1, lcm_entries[0]) == 32, "found %lld\n",
-                (long long)(int)offsetof(struct lov_comp_md_v1, lcm_entries[0]));
-       LASSERTF((int)sizeof(((struct lov_comp_md_v1 *)0)->lcm_entries[0]) == 48, "found %lld\n",
-                (long long)(int)sizeof(((struct lov_comp_md_v1 *)0)->lcm_entries[0]));
+       LASSERTF((int)offsetof(struct lov_comp_md_v1, lcm_entries) == 32, "found %lld\n",
+                (long long)(int)offsetof(struct lov_comp_md_v1, lcm_entries));
+       LASSERTF((int)sizeof(*((struct lov_comp_md_v1 *)0)->lcm_entries) == 48, "found %lld\n",
+                (long long)(int)sizeof(*((struct lov_comp_md_v1 *)0)->lcm_entries));
+       BUILD_BUG_ON(offsetof(struct lov_comp_md_v1, lcm_entries) != sizeof(struct lov_comp_md_v1));
        BUILD_BUG_ON(LOV_MAGIC_COMP_V1 != (0x0BD60000 | 0x0BD0));
        LASSERTF(LCM_FL_NONE == 0, "found %lld\n",
                 (long long)LCM_FL_NONE);
@@ -4995,6 +4996,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct fiemap *)0)->fm_reserved));
        LASSERTF((int)offsetof(struct fiemap, fm_extents) == 32, "found %lld\n",
                 (long long)(int)offsetof(struct fiemap, fm_extents));
+       LASSERTF((int)sizeof(*((struct fiemap *)0)->fm_extents) == 56, "found %lld\n",
+                (long long)(int)sizeof(*((struct fiemap *)0)->fm_extents));
        BUILD_BUG_ON(offsetof(struct fiemap, fm_extents) != sizeof(struct fiemap));
        BUILD_BUG_ON(FIEMAP_FLAG_SYNC != 0x00000001);
        BUILD_BUG_ON(FIEMAP_FLAG_XATTR != 0x00000002);
@@ -5210,6 +5213,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct hsm_action_list *)0)->padding1));
        LASSERTF((int)offsetof(struct hsm_action_list, hal_fsname) == 32, "found %lld\n",
                 (long long)(int)offsetof(struct hsm_action_list, hal_fsname));
+       LASSERTF((int)sizeof(*((struct hsm_action_list *)0)->hal_fsname) == 1, "found %lld\n",
+                (long long)(int)sizeof(*((struct hsm_action_list *)0)->hal_fsname));
        BUILD_BUG_ON(offsetof(struct hsm_action_list, hal_fsname) != sizeof(struct hsm_action_list));
 
        /* Checks for struct hsm_progress */
@@ -5680,6 +5685,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct object_update_param *)0)->oup_padding2));
        LASSERTF((int)offsetof(struct object_update_param, oup_buf) == 8, "found %lld\n",
                 (long long)(int)offsetof(struct object_update_param, oup_buf));
+       LASSERTF((int)sizeof(*((struct object_update_param *)0)->oup_buf) == 1, "found %lld\n",
+                (long long)(int)sizeof(*((struct object_update_param *)0)->oup_buf));
        BUILD_BUG_ON(offsetof(struct object_update_param, oup_buf) != sizeof(struct object_update_param));
 
        /* Checks for struct object_update */
@@ -5715,6 +5722,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct object_update *)0)->ou_fid));
        LASSERTF((int)offsetof(struct object_update, ou_params) == 40, "found %lld\n",
                 (long long)(int)offsetof(struct object_update, ou_params));
+       LASSERTF((int)sizeof(*((struct object_update *)0)->ou_params) == 8, "found %lld\n",
+                (long long)(int)sizeof(*((struct object_update *)0)->ou_params));
        BUILD_BUG_ON(offsetof(struct object_update, ou_params) != sizeof(struct object_update));
        BUILD_BUG_ON(UPDATE_FL_OST != 0x00000001);
        BUILD_BUG_ON(UPDATE_FL_SYNC != 0x00000002);
@@ -5738,6 +5747,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct object_update_request *)0)->ourq_padding));
        LASSERTF((int)offsetof(struct object_update_request, ourq_updates) == 8, "found %lld\n",
                 (long long)(int)offsetof(struct object_update_request, ourq_updates));
+       LASSERTF((int)sizeof(*((struct object_update_request *)0)->ourq_updates) == 40, "found %lld\n",
+                (long long)(int)sizeof(*((struct object_update_request *)0)->ourq_updates));
        BUILD_BUG_ON(offsetof(struct object_update_request, ourq_updates) != sizeof(struct object_update_request));
        BUILD_BUG_ON(UPDATE_REQUEST_MAGIC != 0xBDDE0002);
 
@@ -5758,6 +5769,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct object_update_result *)0)->our_padding));
        LASSERTF((int)offsetof(struct object_update_result, our_data) == 8, "found %lld\n",
                 (long long)(int)offsetof(struct object_update_result, our_data));
+       LASSERTF((int)sizeof(*((struct object_update_result *)0)->our_data) == 4, "found %lld\n",
+                (long long)(int)sizeof(*((struct object_update_result *)0)->our_data));
        BUILD_BUG_ON(offsetof(struct object_update_result, our_data) != sizeof(struct object_update_result));
 
        /* Checks for struct object_update_reply */
@@ -5777,6 +5790,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct object_update_reply *)0)->ourp_padding));
        LASSERTF((int)offsetof(struct object_update_reply, ourp_lens) == 8, "found %lld\n",
                 (long long)(int)offsetof(struct object_update_reply, ourp_lens));
+       LASSERTF((int)sizeof(*((struct object_update_reply *)0)->ourp_lens) == 2, "found %lld\n",
+                (long long)(int)sizeof(*((struct object_update_reply *)0)->ourp_lens));
        BUILD_BUG_ON(offsetof(struct object_update_reply, ourp_lens) != sizeof(struct object_update_reply));
        BUILD_BUG_ON(UPDATE_REPLY_MAGIC != 0x00BD0002);
 
@@ -5801,6 +5816,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct out_update_header *)0)->ouh_reply_size));
        LASSERTF((int)offsetof(struct out_update_header, ouh_inline_data) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct out_update_header, ouh_inline_data));
+       LASSERTF((int)sizeof(*((struct out_update_header *)0)->ouh_inline_data) == 4, "found %lld\n",
+                (long long)(int)sizeof(*((struct out_update_header *)0)->ouh_inline_data));
        BUILD_BUG_ON(offsetof(struct out_update_header, ouh_inline_data) != sizeof(struct out_update_header));
        BUILD_BUG_ON(OUT_UPDATE_HEADER_MAGIC != 0xBDDF0001);
        BUILD_BUG_ON(OUT_UPDATE_MAX_INLINE_SIZE != 4096);