Whamcloud - gitweb
LU-1866 misc: fix some issues found during LFSCK
[fs/lustre-release.git] / lustre / utils / wiretest.c
index 306a444..bb70dbb 100644 (file)
@@ -58,12 +58,13 @@ int main()
 
         return ret;
 }
+
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux centos6-bis 2.6.32-279.2.1.el6-head #0 SMP Thu Aug 9 23:25:09 CEST 2012 x
-         * with gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)  */
+         * running on Linux testnode 2.6.32-279.5.1.el6_lustre.g53f705f.x86_64 #1 SMP Mon Oct 8 05:12
+         * with gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)  */
 
 
        /* Constants... */
@@ -341,6 +342,10 @@ void lustre_assert_wire_constants(void)
        CLASSERT(LDLM_MAX_TYPE == 14);
        CLASSERT(LUSTRE_RES_ID_SEQ_OFF == 0);
        CLASSERT(LUSTRE_RES_ID_VER_OID_OFF == 1);
+       LASSERTF(UPDATE_OBJ == 1000, "found %lld\n",
+                (long long)UPDATE_OBJ);
+       LASSERTF(UPDATE_LAST_OPC == 1001, "found %lld\n",
+                (long long)UPDATE_LAST_OPC);
        CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2);
        CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3);
        CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
@@ -441,6 +446,30 @@ void lustre_assert_wire_constants(void)
                (unsigned)LMAC_HSM);
        LASSERTF(LMAC_SOM == 0x00000002UL, "found 0x%.8xUL\n",
                (unsigned)LMAC_SOM);
+       LASSERTF(OBJ_CREATE == 1, "found %lld\n",
+                (long long)OBJ_CREATE);
+       LASSERTF(OBJ_DESTROY == 2, "found %lld\n",
+                (long long)OBJ_DESTROY);
+       LASSERTF(OBJ_REF_ADD == 3, "found %lld\n",
+                (long long)OBJ_REF_ADD);
+       LASSERTF(OBJ_REF_DEL == 4, "found %lld\n",
+                (long long)OBJ_REF_DEL);
+       LASSERTF(OBJ_ATTR_SET == 5, "found %lld\n",
+                (long long)OBJ_ATTR_SET);
+       LASSERTF(OBJ_ATTR_GET == 6, "found %lld\n",
+                (long long)OBJ_ATTR_GET);
+       LASSERTF(OBJ_XATTR_SET == 7, "found %lld\n",
+                (long long)OBJ_XATTR_SET);
+       LASSERTF(OBJ_XATTR_GET == 8, "found %lld\n",
+                (long long)OBJ_XATTR_GET);
+       LASSERTF(OBJ_INDEX_LOOKUP == 9, "found %lld\n",
+                (long long)OBJ_INDEX_LOOKUP);
+       LASSERTF(OBJ_INDEX_LOOKUP == 9, "found %lld\n",
+                (long long)OBJ_INDEX_LOOKUP);
+       LASSERTF(OBJ_INDEX_INSERT == 10, "found %lld\n",
+                (long long)OBJ_INDEX_INSERT);
+       LASSERTF(OBJ_INDEX_DELETE == 11, "found %lld\n",
+                (long long)OBJ_INDEX_DELETE);
 
        /* Checks for struct som_attrs */
        LASSERTF((int)sizeof(struct som_attrs) == 40, "found %lld\n",
@@ -1923,10 +1952,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct mdt_body, blocks));
        LASSERTF((int)sizeof(((struct mdt_body *)0)->blocks) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct mdt_body *)0)->blocks));
-       LASSERTF((int)offsetof(struct mdt_body, ino) == 96, "found %lld\n",
-                (long long)(int)offsetof(struct mdt_body, ino));
-       LASSERTF((int)sizeof(((struct mdt_body *)0)->ino) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct mdt_body *)0)->ino));
+       LASSERTF((int)offsetof(struct mdt_body, unused1) == 96, "found %lld\n",
+                (long long)(int)offsetof(struct mdt_body, unused1));
+       LASSERTF((int)sizeof(((struct mdt_body *)0)->unused1) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct mdt_body *)0)->unused1));
        LASSERTF((int)offsetof(struct mdt_body, fsuid) == 104, "found %lld\n",
                 (long long)(int)offsetof(struct mdt_body, fsuid));
        LASSERTF((int)sizeof(((struct mdt_body *)0)->fsuid) == 4, "found %lld\n",
@@ -1963,10 +1992,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct mdt_body, nlink));
        LASSERTF((int)sizeof(((struct mdt_body *)0)->nlink) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct mdt_body *)0)->nlink));
-       LASSERTF((int)offsetof(struct mdt_body, generation) == 140, "found %lld\n",
-                (long long)(int)offsetof(struct mdt_body, generation));
-       LASSERTF((int)sizeof(((struct mdt_body *)0)->generation) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct mdt_body *)0)->generation));
+       LASSERTF((int)offsetof(struct mdt_body, unused2) == 140, "found %lld\n",
+                (long long)(int)offsetof(struct mdt_body, unused2));
+       LASSERTF((int)sizeof(((struct mdt_body *)0)->unused2) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct mdt_body *)0)->unused2));
        LASSERTF((int)offsetof(struct mdt_body, suppgid) == 144, "found %lld\n",
                 (long long)(int)offsetof(struct mdt_body, suppgid));
        LASSERTF((int)sizeof(((struct mdt_body *)0)->suppgid) == 4, "found %lld\n",
@@ -4430,5 +4459,61 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct hsm_user_request, hur_user_item));
        LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_user_item) == 0, "found %lld\n",
                 (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_user_item));
+
+       /* Checks for struct update_buf */
+       LASSERTF((int)sizeof(struct update_buf) == 8, "found %lld\n",
+                (long long)(int)sizeof(struct update_buf));
+       LASSERTF((int)offsetof(struct update_buf, ub_magic) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct update_buf, ub_magic));
+       LASSERTF((int)sizeof(((struct update_buf *)0)->ub_magic) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_buf *)0)->ub_magic));
+       LASSERTF((int)offsetof(struct update_buf, ub_count) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct update_buf, ub_count));
+       LASSERTF((int)sizeof(((struct update_buf *)0)->ub_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_buf *)0)->ub_count));
+       LASSERTF((int)offsetof(struct update_buf, ub_bufs) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct update_buf, ub_bufs));
+       LASSERTF((int)sizeof(((struct update_buf *)0)->ub_bufs) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct update_buf *)0)->ub_bufs));
+
+       /* Checks for struct update_reply */
+       LASSERTF((int)sizeof(struct update_reply) == 8, "found %lld\n",
+                (long long)(int)sizeof(struct update_reply));
+       LASSERTF((int)offsetof(struct update_reply, ur_version) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct update_reply, ur_version));
+       LASSERTF((int)sizeof(((struct update_reply *)0)->ur_version) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_reply *)0)->ur_version));
+       LASSERTF((int)offsetof(struct update_reply, ur_count) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct update_reply, ur_count));
+       LASSERTF((int)sizeof(((struct update_reply *)0)->ur_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_reply *)0)->ur_count));
+       LASSERTF((int)offsetof(struct update_reply, ur_lens) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct update_reply, ur_lens));
+       LASSERTF((int)sizeof(((struct update_reply *)0)->ur_lens) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct update_reply *)0)->ur_lens));
+
+       /* Checks for struct update */
+       LASSERTF((int)sizeof(struct update) == 56, "found %lld\n",
+                (long long)(int)sizeof(struct update));
+       LASSERTF((int)offsetof(struct update, u_type) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct update, u_type));
+       LASSERTF((int)sizeof(((struct update *)0)->u_type) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update *)0)->u_type));
+       LASSERTF((int)offsetof(struct update, u_padding) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct update, u_padding));
+       LASSERTF((int)sizeof(((struct update *)0)->u_padding) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update *)0)->u_padding));
+       LASSERTF((int)offsetof(struct update, u_fid) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct update, u_fid));
+       LASSERTF((int)sizeof(((struct update *)0)->u_fid) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct update *)0)->u_fid));
+       LASSERTF((int)offsetof(struct update, u_lens) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct update, u_lens));
+       LASSERTF((int)sizeof(((struct update *)0)->u_lens) == 32, "found %lld\n",
+                (long long)(int)sizeof(((struct update *)0)->u_lens));
+       LASSERTF((int)offsetof(struct update, u_bufs) == 56, "found %lld\n",
+                (long long)(int)offsetof(struct update, u_bufs));
+       LASSERTF((int)sizeof(((struct update *)0)->u_bufs) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct update *)0)->u_bufs));
 }