Whamcloud - gitweb
LU-7543 obd: reserve connection flag OBD_CONNECT_SUBTREE
[fs/lustre-release.git] / lustre / utils / wiretest.c
index efe13d6..6371bca 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -61,8 +61,9 @@ void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux q 2.6.32-431.5.1.el6.lustre.x86_64 #1 SMP Wed Feb 12 11:01:08 CST 2014 x8
-         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)  */
+         * running on Linux centss05 2.6.32.431.29.2.el6_lustre #1 SMP Tue Sep 23 16:06:38 CDT 2014 x
+         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)  */
+
 
        /* Constants... */
        LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
@@ -232,8 +233,6 @@ void lustre_assert_wire_constants(void)
                 (long long)MDS_STATUS_CONN);
        LASSERTF(MDS_STATUS_LOV == 2, "found %lld\n",
                 (long long)MDS_STATUS_LOV);
-       LASSERTF(LUSTRE_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n",
-                (long long)LUSTRE_BFLAG_UNCOMMITTED_WRITES);
        LASSERTF(MDS_ATTR_MODE == 0x0000000000000001ULL, "found 0x%.16llxULL\n",
                        (long long)MDS_ATTR_MODE);
        LASSERTF(MDS_ATTR_UID == 0x0000000000000002ULL, "found 0x%.16llxULL\n",
@@ -872,7 +871,6 @@ void lustre_assert_wire_constants(void)
                 (int)offsetof(struct ptlrpc_body_v3, pb_padding64_2), (int)offsetof(struct ptlrpc_body_v2, pb_padding64_2));
        LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding64_2) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding64_2), "%d != %d\n",
                 (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding64_2), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding64_2));
-
        LASSERTF(MSG_PTLRPC_BODY_OFF == 0, "found %lld\n",
                 (long long)MSG_PTLRPC_BODY_OFF);
        LASSERTF(REQ_REC_OFF == 1, "found %lld\n",
@@ -1199,6 +1197,10 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT_MULTIMODRPCS);
        LASSERTF(OBD_CONNECT_DIR_STRIPE == 0x400000000000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT_DIR_STRIPE);
+       LASSERTF(OBD_CONNECT_SUBTREE == 0x800000000000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT_SUBTREE);
+       LASSERTF(OBD_CONNECT_BULK_MBITS == 0x2000000000000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT_BULK_MBITS);
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);
        LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
@@ -2169,10 +2171,20 @@ void lustre_assert_wire_constants(void)
                LUSTRE_IMMUTABLE_FL);
        LASSERTF(LUSTRE_APPEND_FL == 0x00000020, "found 0x%.8x\n",
                LUSTRE_APPEND_FL);
+       LASSERTF(LUSTRE_NODUMP_FL == 0x00000040, "found 0x%.8x\n",
+               LUSTRE_NODUMP_FL);
        LASSERTF(LUSTRE_NOATIME_FL == 0x00000080, "found 0x%.8x\n",
                LUSTRE_NOATIME_FL);
+       LASSERTF(LUSTRE_INDEX_FL == 0x00001000, "found 0x%.8x\n",
+               LUSTRE_INDEX_FL);
        LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n",
                LUSTRE_DIRSYNC_FL);
+       LASSERTF(LUSTRE_TOPDIR_FL == 0x00020000, "found 0x%.8x\n",
+               LUSTRE_TOPDIR_FL);
+       LASSERTF(LUSTRE_DIRECTIO_FL == 0x00100000, "found 0x%.8x\n",
+               LUSTRE_DIRECTIO_FL);
+       LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000, "found 0x%.8x\n",
+               LUSTRE_INLINE_DATA_FL);
        LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n",
                MDS_INODELOCK_LOOKUP);
        LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",
@@ -3089,6 +3101,34 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct ldlm_intent, opc));
        LASSERTF((int)sizeof(((struct ldlm_intent *)0)->opc) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct ldlm_intent *)0)->opc));
+       LASSERTF(IT_OPEN == 1, "found %lld\n",
+                (long long)IT_OPEN);
+       LASSERTF(IT_CREAT == 2, "found %lld\n",
+                (long long)IT_CREAT);
+       LASSERTF(IT_READDIR == 4, "found %lld\n",
+                (long long)IT_READDIR);
+       LASSERTF(IT_GETATTR == 8, "found %lld\n",
+                (long long)IT_GETATTR);
+       LASSERTF(IT_LOOKUP == 16, "found %lld\n",
+                (long long)IT_LOOKUP);
+       LASSERTF(IT_UNLINK == 32, "found %lld\n",
+                (long long)IT_UNLINK);
+       LASSERTF(IT_TRUNC == 64, "found %lld\n",
+                (long long)IT_TRUNC);
+       LASSERTF(IT_GETXATTR == 128, "found %lld\n",
+                (long long)IT_GETXATTR);
+       LASSERTF(IT_EXEC == 256, "found %lld\n",
+                (long long)IT_EXEC);
+       LASSERTF(IT_PIN == 512, "found %lld\n",
+                (long long)IT_PIN);
+       LASSERTF(IT_LAYOUT == 1024, "found %lld\n",
+                (long long)IT_LAYOUT);
+       LASSERTF(IT_QUOTA_DQACQ == 2048, "found %lld\n",
+                (long long)IT_QUOTA_DQACQ);
+       LASSERTF(IT_QUOTA_CONN == 4096, "found %lld\n",
+                (long long)IT_QUOTA_CONN);
+       LASSERTF(IT_SETXATTR == 8192, "found %lld\n",
+                (long long)IT_SETXATTR);
 
        /* Checks for struct ldlm_resource_desc */
        LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n",
@@ -3097,10 +3137,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct ldlm_resource_desc, lr_type));
        LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_type));
-       LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_padding) == 4, "found %lld\n",
-                (long long)(int)offsetof(struct ldlm_resource_desc, lr_padding));
-       LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_padding) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_padding));
+       LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_pad) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct ldlm_resource_desc, lr_pad));
+       LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_pad) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_pad));
        LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_name) == 8, "found %lld\n",
                 (long long)(int)offsetof(struct ldlm_resource_desc, lr_name));
        LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32, "found %lld\n",
@@ -4544,10 +4584,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct object_update, ou_params_count));
        LASSERTF((int)sizeof(((struct object_update *)0)->ou_params_count) == 2, "found %lld\n",
                 (long long)(int)sizeof(((struct object_update *)0)->ou_params_count));
-       LASSERTF((int)offsetof(struct object_update, ou_master_index) == 4, "found %lld\n",
-                (long long)(int)offsetof(struct object_update, ou_master_index));
-       LASSERTF((int)sizeof(((struct object_update *)0)->ou_master_index) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct object_update *)0)->ou_master_index));
+       LASSERTF((int)offsetof(struct object_update, ou_result_size) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct object_update, ou_result_size));
+       LASSERTF((int)sizeof(((struct object_update *)0)->ou_result_size) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct object_update *)0)->ou_result_size));
        LASSERTF((int)offsetof(struct object_update, ou_flags) == 8, "found %lld\n",
                 (long long)(int)offsetof(struct object_update, ou_flags));
        LASSERTF((int)sizeof(((struct object_update *)0)->ou_flags) == 4, "found %lld\n",
@@ -4629,6 +4669,42 @@ void lustre_assert_wire_constants(void)
        LASSERTF((int)sizeof(((struct object_update_reply *)0)->ourp_lens) == 0, "found %lld\n",
                 (long long)(int)sizeof(((struct object_update_reply *)0)->ourp_lens));
 
+       /* Checks for struct out_update_header */
+       LASSERTF((int)sizeof(struct out_update_header) == 16, "found %lld\n",
+                (long long)(int)sizeof(struct out_update_header));
+       LASSERTF((int)offsetof(struct out_update_header, ouh_magic) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct out_update_header, ouh_magic));
+       LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_magic) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct out_update_header *)0)->ouh_magic));
+       LASSERTF((int)offsetof(struct out_update_header, ouh_count) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct out_update_header, ouh_count));
+       LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct out_update_header *)0)->ouh_count));
+       LASSERTF((int)offsetof(struct out_update_header, ouh_inline_length) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct out_update_header, ouh_inline_length));
+       LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_inline_length) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct out_update_header *)0)->ouh_inline_length));
+       LASSERTF((int)offsetof(struct out_update_header, ouh_reply_size) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct out_update_header, ouh_reply_size));
+       LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_reply_size) == 4, "found %lld\n",
+                (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) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct out_update_header *)0)->ouh_inline_data));
+
+       /* Checks for struct out_update_buffer */
+       LASSERTF((int)sizeof(struct out_update_buffer) == 8, "found %lld\n",
+                (long long)(int)sizeof(struct out_update_buffer));
+       LASSERTF((int)offsetof(struct out_update_buffer, oub_size) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct out_update_buffer, oub_size));
+       LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_size) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_size));
+       LASSERTF((int)offsetof(struct out_update_buffer, oub_padding) == 4, "found %lld\n",
+                (long long)(int)offsetof(struct out_update_buffer, oub_padding));
+       LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_padding) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_padding));
+
        /* Checks for struct lfsck_request */
        LASSERTF((int)sizeof(struct lfsck_request) == 96, "found %lld\n",
                 (long long)(int)sizeof(struct lfsck_request));
@@ -4754,4 +4830,82 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct lfsck_reply, lr_padding_2));
        LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
+
+       /* Checks for struct update_params */
+       LASSERTF((int)sizeof(struct update_params) == 0, "found %lld\n",
+                (long long)(int)sizeof(struct update_params));
+       LASSERTF((int)offsetof(struct update_params, up_params) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct update_params, up_params));
+       LASSERTF((int)sizeof(((struct update_params *)0)->up_params) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct update_params *)0)->up_params));
+
+       /* Checks for struct update_op */
+       LASSERTF((int)sizeof(struct update_op) == 24, "found %lld\n",
+                (long long)(int)sizeof(struct update_op));
+       LASSERTF((int)offsetof(struct update_op, uop_fid) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct update_op, uop_fid));
+       LASSERTF((int)sizeof(((struct update_op *)0)->uop_fid) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct update_op *)0)->uop_fid));
+       LASSERTF((int)offsetof(struct update_op, uop_type) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct update_op, uop_type));
+       LASSERTF((int)sizeof(((struct update_op *)0)->uop_type) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct update_op *)0)->uop_type));
+       LASSERTF((int)offsetof(struct update_op, uop_param_count) == 18, "found %lld\n",
+                (long long)(int)offsetof(struct update_op, uop_param_count));
+       LASSERTF((int)sizeof(((struct update_op *)0)->uop_param_count) == 2, "found %lld\n",
+                (long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
+       LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct update_op, uop_params_off));
+       LASSERTF((int)sizeof(((struct update_op *)0)->uop_params_off) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct update_op *)0)->uop_params_off));
+
+       /* Checks for struct update_ops */
+       LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",
+                (long long)(int)sizeof(struct update_ops));
+       LASSERTF((int)offsetof(struct update_ops, uops_op) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct update_ops, uops_op));
+       LASSERTF((int)sizeof(((struct update_ops *)0)->uops_op) == 0, "found %lld\n",
+                (long long)(int)sizeof(((struct update_ops *)0)->uops_op));
+
+       /* Checks for struct update_records */
+       LASSERTF((int)sizeof(struct update_records) == 32, "found %lld\n",
+                (long long)(int)sizeof(struct update_records));
+       LASSERTF((int)offsetof(struct update_records, ur_master_transno) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct update_records, ur_master_transno));
+       LASSERTF((int)sizeof(((struct update_records *)0)->ur_master_transno) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct update_records *)0)->ur_master_transno));
+       LASSERTF((int)offsetof(struct update_records, ur_batchid) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct update_records, ur_batchid));
+       LASSERTF((int)sizeof(((struct update_records *)0)->ur_batchid) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct update_records *)0)->ur_batchid));
+       LASSERTF((int)offsetof(struct update_records, ur_flags) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct update_records, ur_flags));
+       LASSERTF((int)sizeof(((struct update_records *)0)->ur_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_records *)0)->ur_flags));
+       LASSERTF((int)offsetof(struct update_records, ur_index) == 20, "found %lld\n",
+                (long long)(int)offsetof(struct update_records, ur_index));
+       LASSERTF((int)sizeof(((struct update_records *)0)->ur_index) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_records *)0)->ur_index));
+       LASSERTF((int)offsetof(struct update_records, ur_update_count) == 24, "found %lld\n",
+                (long long)(int)offsetof(struct update_records, ur_update_count));
+       LASSERTF((int)sizeof(((struct update_records *)0)->ur_update_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_records *)0)->ur_update_count));
+       LASSERTF((int)offsetof(struct update_records, ur_param_count) == 28, "found %lld\n",
+                (long long)(int)offsetof(struct update_records, ur_param_count));
+       LASSERTF((int)sizeof(((struct update_records *)0)->ur_param_count) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct update_records *)0)->ur_param_count));
+       LASSERTF(UPDATE_RECORD_CONTINUE == 0x00000001UL, "found 0x%.8xUL\n",
+               (unsigned)UPDATE_RECORD_CONTINUE);
+
+       /* Checks for struct llog_update_record */
+       LASSERTF((int)sizeof(struct llog_update_record) == 48, "found %lld\n",
+                (long long)(int)sizeof(struct llog_update_record));
+       LASSERTF((int)offsetof(struct llog_update_record, lur_hdr) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct llog_update_record, lur_hdr));
+       LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_hdr) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_update_record *)0)->lur_hdr));
+       LASSERTF((int)offsetof(struct llog_update_record, lur_update_rec) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct llog_update_record, lur_update_rec));
+       LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_update_rec) == 32, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_update_record *)0)->lur_update_rec));
 }