Whamcloud - gitweb
Landing b_bug974 onto HEAD (20040213_1538).
[fs/lustre-release.git] / lustre / utils / wiretest.c
index 6192b23..9f8bcd0 100644 (file)
@@ -14,11 +14,18 @@ int main()
 {
        lustre_assert_wire_constants();
 
+       if (ret == 0)
+               printf("wire constants OK\n");
+
        return ret;
 }
+
 void lustre_assert_wire_constants(void)
 {
-        /* Wire protocol assertions generated by 'wirecheck' */
+        /* Wire protocol assertions generated by 'wirecheck'
+         * running on Linux schnapps.adilger.int 2.4.22-l32 #4 Thu Jan 8 14:32:57 MST 2004 i686 i686 
+         * with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) */
+
 
         /* Constants... */
         LASSERT(PTLRPC_MSG_MAGIC == 0x0BD00BD0);
@@ -49,9 +56,6 @@ void lustre_assert_wire_constants(void)
         LASSERT(OST_SAN_WRITE == 15);
         LASSERT(OST_SYNC == 16);
         LASSERT(OST_LAST_OPC == 18);
-        LASSERT(OST_FIRST_OPC == 0);
-        LASSERT(OBD_FL_INLINEDATA == 1);
-        LASSERT(OBD_FL_OBDMDEXISTS == 2);
         LASSERT(OBD_OBJECT_EOF == 0xffffffffffffffffULL);
         LASSERT(OST_REQ_HAS_OA1 == 1);
         LASSERT(MDS_GETATTR == 33);
@@ -63,8 +67,11 @@ void lustre_assert_wire_constants(void)
         LASSERT(MDS_DISCONNECT == 39);
         LASSERT(MDS_GETSTATUS == 40);
         LASSERT(MDS_STATFS == 41);
-        LASSERT(MDS_LAST_OPC == 45);
-        LASSERT(MDS_FIRST_OPC == 33);
+        LASSERT(MDS_PIN == 42);
+        LASSERT(MDS_UNPIN == 43);
+        LASSERT(MDS_SYNC == 44);
+        LASSERT(MDS_DONE_WRITING == 45);
+        LASSERT(MDS_LAST_OPC == 46);
         LASSERT(REINT_SETATTR == 1);
         LASSERT(REINT_CREATE == 2);
         LASSERT(REINT_LINK == 3);
@@ -87,7 +94,12 @@ void lustre_assert_wire_constants(void)
         LASSERT(LDLM_BL_CALLBACK == 104);
         LASSERT(LDLM_CP_CALLBACK == 105);
         LASSERT(LDLM_LAST_OPC == 106);
-        LASSERT(LDLM_FIRST_OPC == 101);
+        LASSERT(LCK_EX == 1);
+        LASSERT(LCK_PW == 2);
+        LASSERT(LCK_PR == 3);
+        LASSERT(LCK_CW == 4);
+        LASSERT(LCK_CR == 5);
+        LASSERT(LCK_NL == 6);
         LASSERT(PTLBD_QUERY == 200);
         LASSERT(PTLBD_READ == 201);
         LASSERT(PTLBD_WRITE == 202);
@@ -95,8 +107,12 @@ void lustre_assert_wire_constants(void)
         LASSERT(PTLBD_CONNECT == 204);
         LASSERT(PTLBD_DISCONNECT == 205);
         LASSERT(PTLBD_LAST_OPC == 206);
-        LASSERT(PTLBD_FIRST_OPC == 200);
+        LASSERT(MGMT_CONNECT == 250);
+        LASSERT(MGMT_DISCONNECT == 251);
+        LASSERT(MGMT_EXCEPTION == 252);
         LASSERT(OBD_PING == 400);
+        LASSERT(OBD_LOG_CANCEL == 401);
+        LASSERT(OBD_LAST_OPC == 402);
         /* Sizes and Offsets */
 
 
@@ -166,8 +182,8 @@ void lustre_assert_wire_constants(void)
         LASSERT((int)sizeof(((struct obdo *)0)->o_generation) == 4);
         LASSERT(offsetof(struct obdo, o_valid) == 92);
         LASSERT((int)sizeof(((struct obdo *)0)->o_valid) == 4);
-        LASSERT(offsetof(struct obdo, o_obdflags) == 96);
-        LASSERT((int)sizeof(((struct obdo *)0)->o_obdflags) == 4);
+        LASSERT(offsetof(struct obdo, o_misc) == 96);
+        LASSERT((int)sizeof(((struct obdo *)0)->o_misc) == 4);
         LASSERT(offsetof(struct obdo, o_easize) == 100);
         LASSERT((int)sizeof(((struct obdo *)0)->o_easize) == 4);
         LASSERT(offsetof(struct obdo, o_inline) == 104);
@@ -184,7 +200,6 @@ void lustre_assert_wire_constants(void)
         LASSERT(OBD_MD_FLUID == 512);
         LASSERT(OBD_MD_FLGID == 1024);
         LASSERT(OBD_MD_FLFLAGS == 2048);
-        LASSERT(OBD_MD_FLOBDFLG == 4096);
         LASSERT(OBD_MD_FLNLINK == 8192);
         LASSERT(OBD_MD_FLGENER == 16384);
         LASSERT(OBD_MD_FLINLINE == 32768);
@@ -197,6 +212,12 @@ void lustre_assert_wire_constants(void)
         LASSERT(OBD_MD_FLOSCOPQ == 4194304);
         LASSERT(OBD_MD_FLCOOKIE == 8388608);
         LASSERT(OBD_MD_FLGROUP == 16777216);
+        LASSERT(OBD_FL_INLINEDATA == 1);
+        LASSERT(OBD_FL_OBDMDEXISTS == 2);
+        LASSERT(OBD_FL_DELORPHAN == 4);
+        LASSERT(OBD_FL_NORPC == 8);
+        LASSERT(OBD_FL_IDONLY == 16);
+        LASSERT(OBD_FL_RECREATE_OBJS == 32);
 
         /* Checks for struct lov_mds_md_v1 */
         LASSERT((int)sizeof(struct lov_mds_md_v1) == 32);
@@ -272,8 +293,8 @@ void lustre_assert_wire_constants(void)
         LASSERT((int)sizeof(((struct niobuf_remote *)0)->flags) == 4);
         LASSERT(OBD_BRW_READ == 1);
         LASSERT(OBD_BRW_WRITE == 2);
-        LASSERT(OBD_BRW_CREATE == 4);
         LASSERT(OBD_BRW_SYNC == 8);
+        LASSERT(OBD_BRW_FROM_GRANT == 32);
 
         /* Checks for struct ost_body */
         LASSERT((int)sizeof(struct ost_body) == 168);
@@ -349,6 +370,7 @@ void lustre_assert_wire_constants(void)
         LASSERT(FMODE_EXEC == 4);
         LASSERT(MDS_OPEN_CREAT == 64);
         LASSERT(MDS_OPEN_EXCL == 128);
+        LASSERT(MDS_OPEN_TRUNC == 512);
         LASSERT(MDS_OPEN_APPEND == 1024);
         LASSERT(MDS_OPEN_SYNC == 4096);
         LASSERT(MDS_OPEN_DIRECTORY == 65536);
@@ -617,6 +639,7 @@ void lustre_assert_wire_constants(void)
         LASSERT(MDS_UNLINK_REC == 274801668);
         LASSERT(OBD_CFG_REC == 274857984);
         LASSERT(PTL_CFG_REC == 274923520);
+        LASSERT(LLOG_GEN_REC == 274989056);
         LASSERT(LLOG_HDR_MAGIC == 275010873);
         LASSERT(LLOG_LOGID_MAGIC == 275010874);
 
@@ -636,6 +659,75 @@ void lustre_assert_wire_constants(void)
         LASSERT(offsetof(struct llog_rec_tail, lrt_index) == 4);
         LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4);
 
+        /* Checks for struct llog_logid_rec */
+        LASSERT((int)sizeof(struct llog_logid_rec) == 48);
+        LASSERT(offsetof(struct llog_logid_rec, lid_hdr) == 0);
+        LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_hdr) == 16);
+        LASSERT(offsetof(struct llog_logid_rec, lid_id) == 16);
+        LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_id) == 20);
+        LASSERT(offsetof(struct llog_logid_rec, lid_tail) == 40);
+        LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_tail) == 8);
+
+        /* Checks for struct llog_create_rec */
+        LASSERT((int)sizeof(struct llog_create_rec) == 56);
+        LASSERT(offsetof(struct llog_create_rec, lcr_hdr) == 0);
+        LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_hdr) == 16);
+        LASSERT(offsetof(struct llog_create_rec, lcr_fid) == 16);
+        LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_fid) == 16);
+        LASSERT(offsetof(struct llog_create_rec, lcr_oid) == 32);
+        LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8);
+        LASSERT(offsetof(struct llog_create_rec, lcr_ogen) == 40);
+        LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_ogen) == 4);
+
+        /* Checks for struct llog_orphan_rec */
+        LASSERT((int)sizeof(struct llog_orphan_rec) == 40);
+        LASSERT(offsetof(struct llog_orphan_rec, lor_hdr) == 0);
+        LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr) == 16);
+        LASSERT(offsetof(struct llog_orphan_rec, lor_oid) == 16);
+        LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_oid) == 8);
+        LASSERT(offsetof(struct llog_orphan_rec, lor_ogen) == 24);
+        LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen) == 4);
+        LASSERT(offsetof(struct llog_orphan_rec, lor_tail) == 32);
+        LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_tail) == 8);
+
+        /* Checks for struct llog_unlink_rec */
+        LASSERT((int)sizeof(struct llog_unlink_rec) == 40);
+        LASSERT(offsetof(struct llog_unlink_rec, lur_hdr) == 0);
+        LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr) == 16);
+        LASSERT(offsetof(struct llog_unlink_rec, lur_oid) == 16);
+        LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8);
+        LASSERT(offsetof(struct llog_unlink_rec, lur_ogen) == 24);
+        LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen) == 4);
+        LASSERT(offsetof(struct llog_unlink_rec, lur_tail) == 32);
+        LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_tail) == 8);
+
+        /* Checks for struct llog_size_change_rec */
+        LASSERT((int)sizeof(struct llog_size_change_rec) == 48);
+        LASSERT(offsetof(struct llog_size_change_rec, lsc_hdr) == 0);
+        LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr) == 16);
+        LASSERT(offsetof(struct llog_size_change_rec, lsc_fid) == 16);
+        LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid) == 16);
+        LASSERT(offsetof(struct llog_size_change_rec, lsc_io_epoch) == 32);
+        LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch) == 4);
+        LASSERT(offsetof(struct llog_size_change_rec, lsc_tail) == 40);
+        LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail) == 8);
+
+        /* Checks for struct llog_gen */
+        LASSERT((int)sizeof(struct llog_gen) == 16);
+        LASSERT(offsetof(struct llog_gen, mnt_cnt) == 0);
+        LASSERT((int)sizeof(((struct llog_gen *)0)->mnt_cnt) == 8);
+        LASSERT(offsetof(struct llog_gen, conn_cnt) == 8);
+        LASSERT((int)sizeof(((struct llog_gen *)0)->conn_cnt) == 8);
+
+        /* Checks for struct llog_gen_rec */
+        LASSERT((int)sizeof(struct llog_gen_rec) == 40);
+        LASSERT(offsetof(struct llog_gen_rec, lgr_hdr) == 0);
+        LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr) == 16);
+        LASSERT(offsetof(struct llog_gen_rec, lgr_gen) == 16);
+        LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_gen) == 16);
+        LASSERT(offsetof(struct llog_gen_rec, lgr_tail) == 32);
+        LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_tail) == 8);
+
         /* Checks for struct llog_log_hdr */
         LASSERT((int)sizeof(struct llog_log_hdr) == 4096);
         LASSERT(offsetof(struct llog_log_hdr, llh_hdr) == 0);
@@ -691,6 +783,8 @@ void lustre_assert_wire_constants(void)
         LASSERT(LLOG_ORIGIN_HANDLE_READ_HEADER == 503);
         LASSERT(LLOG_ORIGIN_HANDLE_WRITE_REC == 504);
         LASSERT(LLOG_ORIGIN_HANDLE_CLOSE == 505);
+        LASSERT(LLOG_ORIGIN_CONNECT == 506);
+        LASSERT(LLOG_CATINFO == 507);
 
         /* Checks for struct llogd_conn_body */
         LASSERT((int)sizeof(struct llogd_conn_body) == 40);