Whamcloud - gitweb
LU-1198 idl: move FID VER to DLM resource name[1]
[fs/lustre-release.git] / lustre / utils / wiretest.c
index 1de4005..76dcca4 100644 (file)
@@ -28,9 +28,8 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
- */
-/*
- * Copyright (c) 2011 Whamcloud, Inc.
+ *
+ * Copyright (c) 2011, 2012, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -344,6 +343,9 @@ void lustre_assert_wire_constants(void)
         CLASSERT(LDLM_FLOCK == 12);
         CLASSERT(LDLM_IBITS == 13);
         CLASSERT(LDLM_MAX_TYPE == 14);
+        CLASSERT(LUSTRE_RES_ID_SEQ_OFF == 0);
+        CLASSERT(LUSTRE_RES_ID_VER_OID_OFF == 1);
+        CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
         LASSERTF(OBD_PING == 400, "found %lld\n",
                  (long long)OBD_PING);
         LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n",
@@ -811,15 +813,25 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_ibits_known));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_nllu) == 32, "found %lld\n",
-                 (long long)(int)offsetof(struct obd_connect_data, ocd_nllu));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllu) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllu));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_nllg) == 36, "found %lld\n",
-                 (long long)(int)offsetof(struct obd_connect_data, ocd_nllg));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllg) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllg));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, "found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_blocksize));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_inodespace));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_grant_extent));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_unused));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_unused));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_transno));
@@ -984,6 +996,12 @@ void lustre_assert_wire_constants(void)
                  OBD_CONNECT_MAXBYTES);
         LASSERTF(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL, "found 0x%.16llxULL\n",
                  OBD_CONNECT_IMP_RECOV);
+        LASSERTF(OBD_CONNECT_JOBSTATS ==  0x20000000000ULL, "found 0x%.16llxULL\n",
+                 OBD_CONNECT_JOBSTATS);
+        LASSERTF(OBD_CONNECT_GRANT_PARAM == 0x40000000000ULL, "found 0x%.16llxULL\n",
+                 OBD_CONNECT_GRANT_PARAM);
+        LASSERTF(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL, "found 0x%.16llxULL\n",
+                 OBD_CONNECT_EINPROGRESS);
         LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                  (unsigned)OBD_CKSUM_CRC32);
         LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
@@ -1094,10 +1112,10 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obdo, o_gid_h));
         LASSERTF((int)sizeof(((struct obdo *)0)->o_gid_h) == 4, "found %lld\n",
                  (long long)(int)sizeof(((struct obdo *)0)->o_gid_h));
-        LASSERTF((int)offsetof(struct obdo, o_padding_3) == 176, " found %lld\n",
-                 (long long)(int)offsetof(struct obdo, o_padding_3));
-        LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_3) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct obdo *)0)->o_padding_3));
+        LASSERTF((int)offsetof(struct obdo, o_data_version) == 176, " found %lld\n",
+                 (long long)(int)offsetof(struct obdo, o_data_version));
+        LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct obdo *)0)->o_data_version));
         LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",
                  (long long)(int)offsetof(struct obdo, o_padding_4));
         LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 8, "found %lld\n",
@@ -1204,6 +1222,8 @@ void lustre_assert_wire_constants(void)
                  OBD_MD_FLRMTRSETFACL);
         LASSERTF(OBD_MD_FLRMTRGETFACL == (0x0008000000000000ULL), "found 0x%.16llxULL\n",
                  OBD_MD_FLRMTRGETFACL);
+        LASSERTF(OBD_MD_FLDATAVERSION == (0x0010000000000000ULL), "found 0x%.16llxULL\n",
+                 OBD_MD_FLDATAVERSION);
         CLASSERT(OBD_FL_INLINEDATA == 0x00000001);
         CLASSERT(OBD_FL_OBDMDEXISTS == 0x00000002);
         CLASSERT(OBD_FL_DELORPHAN == 0x00000004);
@@ -3743,32 +3763,42 @@ void lustre_assert_wire_constants(void)
 #ifdef LIBLUSTRE_POSIX_ACL
 
         /* Checks for type posix_acl_xattr_entry */
-        LASSERTF((int)sizeof(xattr_acl_entry) == 8, "found %lld\n",
-                 (long long)(int)sizeof(xattr_acl_entry));
-        LASSERTF((int)offsetof(xattr_acl_entry, e_tag) == 0, "found %lld\n",
-                 (long long)(int)offsetof(xattr_acl_entry, e_tag));
-        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_tag) == 2, "found %lld\n",
-                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_tag));
-        LASSERTF((int)offsetof(xattr_acl_entry, e_perm) == 2, "found %lld\n",
-                 (long long)(int)offsetof(xattr_acl_entry, e_perm));
-        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_perm) == 2, "found %lld\n",
-                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_perm));
-        LASSERTF((int)offsetof(xattr_acl_entry, e_id) == 4, "found %lld\n",
-                 (long long)(int)offsetof(xattr_acl_entry, e_id));
-        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_id) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_id));
+        LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
+                 (long long)(int)sizeof(posix_acl_xattr_entry));
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0,
+                 "found %lld\n",
+                 (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2,
+                 "found %lld\n",
+                 (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2,
+                 "found %lld\n",
+                 (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2,
+                 "found %lld\n",
+                 (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
+        LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4,
+                 "found %lld\n",
+                 (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
+        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4,
+                 "found %lld\n",
+                 (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
 
         /* Checks for type posix_acl_xattr_header */
-        LASSERTF((int)sizeof(xattr_acl_header) == 4, "found %lld\n",
-                 (long long)(int)sizeof(xattr_acl_header));
-        LASSERTF((int)offsetof(xattr_acl_header, a_version) == 0, "found %lld\n",
-                 (long long)(int)offsetof(xattr_acl_header, a_version));
-        LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_version) == 4, "found %lld\n",
-                 (long long)(int)sizeof(((xattr_acl_header *)0)->a_version));
-        LASSERTF((int)offsetof(xattr_acl_header, a_entries) == 4, "found %lld\n",
-                 (long long)(int)offsetof(xattr_acl_header, a_entries));
-        LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_entries) == 0, "found %lld\n",
-                 (long long)(int)sizeof(((xattr_acl_header *)0)->a_entries));
+        LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n",
+                 (long long)(int)sizeof(posix_acl_xattr_header));
+        LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0,
+                 "found %lld\n",
+                 (long long)(int)offsetof(posix_acl_xattr_header, a_version));
+        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4,
+                 "found %lld\n",
+                 (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
+        LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4,
+                 "found %lld\n",
+                 (long long)(int)offsetof(posix_acl_xattr_header, a_entries));
+        LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0,
+                 "found %lld\n",
+                 (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
 #endif
 
         /* Checks for struct link_ea_header */