Whamcloud - gitweb
LU-5607 ptlrpc: restore posix_acl_xattr checks
[fs/lustre-release.git] / lustre / ptlrpc / wiretest.c
index 62ddffa..e677be9 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
-#ifdef __KERNEL__
-# ifdef CONFIG_FS_POSIX_ACL
-#  include <linux/fs.h>
-#  include <linux/posix_acl_xattr.h>
-# endif
-#endif
+#ifdef CONFIG_FS_POSIX_ACL
+# include <linux/fs.h>
+# include <linux/posix_acl_xattr.h>
+#endif /* CONFIG_FS_POSIX_ACL */
 
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre/lustre_lfsck_user.h>
 #include <lustre_disk.h>
-
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux t 2.6.32-358.18.1.el6.lustre.x86_64 #1 SMP Mon Sep 2 15:21:03 CDT 2013 x8
+         * 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)  */
 
 
@@ -1906,18 +1900,18 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct niobuf_remote */
        LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n",
                 (long long)(int)sizeof(struct niobuf_remote));
-       LASSERTF((int)offsetof(struct niobuf_remote, offset) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct niobuf_remote, offset));
-       LASSERTF((int)sizeof(((struct niobuf_remote *)0)->offset) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct niobuf_remote *)0)->offset));
-       LASSERTF((int)offsetof(struct niobuf_remote, len) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct niobuf_remote, len));
-       LASSERTF((int)sizeof(((struct niobuf_remote *)0)->len) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct niobuf_remote *)0)->len));
-       LASSERTF((int)offsetof(struct niobuf_remote, flags) == 12, "found %lld\n",
-                (long long)(int)offsetof(struct niobuf_remote, flags));
-       LASSERTF((int)sizeof(((struct niobuf_remote *)0)->flags) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct niobuf_remote *)0)->flags));
+       LASSERTF((int)offsetof(struct niobuf_remote, rnb_offset) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct niobuf_remote, rnb_offset));
+       LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_offset) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_offset));
+       LASSERTF((int)offsetof(struct niobuf_remote, rnb_len) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct niobuf_remote, rnb_len));
+       LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_len) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_len));
+       LASSERTF((int)offsetof(struct niobuf_remote, rnb_flags) == 12, "found %lld\n",
+                (long long)(int)offsetof(struct niobuf_remote, rnb_flags));
+       LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_flags) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_flags));
        LASSERTF(OBD_BRW_READ == 0x01, "found 0x%.8x\n",
                OBD_BRW_READ);
        LASSERTF(OBD_BRW_WRITE == 0x02, "found 0x%.8x\n",
@@ -4120,6 +4114,38 @@ void lustre_assert_wire_constants(void)
        CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
        CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
 
+#ifdef CONFIG_FS_POSIX_ACL
+       /* Checks for type posix_acl_xattr_entry */
+       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));
+#endif /* CONFIG_FS_POSIX_ACL */
+
+#ifdef CONFIG_FS_POSIX_ACL
+       /* Checks for type posix_acl_xattr_header */
+       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 /* CONFIG_FS_POSIX_ACL */
+
        /* Checks for struct link_ea_header */
        LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct link_ea_header));