Whamcloud - gitweb
Update an obsolete wirecheck.c generator.
authordeen <deen>
Tue, 24 Jun 2008 13:47:58 +0000 (13:47 +0000)
committerdeen <deen>
Tue, 24 Jun 2008 13:47:58 +0000 (13:47 +0000)
b=15566
i=adilger
i=shadow

lustre/autoconf/lustre-core.m4
lustre/ptlrpc/wiretest.c
lustre/utils/Makefile.am
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index a80ce8a..493a35a 100644 (file)
@@ -1627,11 +1627,8 @@ AC_ARG_ENABLE([liblustre-acl],
        AC_HELP_STRING([--disable-liblustre-acl],
                        [disable ACL support for liblustre]),
        [],[enable_liblustre_acl=yes])
-if test x$enable_liblustre != xyes ; then
-   enable_liblustre_acl='no'
-fi
 AC_MSG_RESULT([$enable_liblustre_acl])
-if test x$enable_liblustre_acl != xno ; then
+if test x$enable_liblustre_acl = xyes ; then
   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
 fi
 
index 3ecb7cf..bb2db8c 100644 (file)
@@ -29,9 +29,9 @@
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
-         * (make -C lustre/utils newwirecheck)
-         * running on Linux rhel5.vbox 2.6.18-prep #1 SMP Fri Feb 22 14:24:02 EET 2008 i686 i686 i386
-         * with gcc version 4.1.2 20070626 (Red Hat 4.1.2-14) */
+         * (make -C lustre/utils newwiretest)
+         * running on Linux xlab.hostel 2.6.23.15-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i68
+         * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-7) */
 
 
         /* Constants... */
@@ -201,6 +201,8 @@ void lustre_assert_wire_constants(void)
                  (long long)LCK_GROUP);
         LASSERTF(LCK_MAXMODE == 65, " found %lld\n",
                  (long long)LCK_MAXMODE);
+        LASSERTF(LCK_MODE_NUM == 7, " found %lld\n",
+                 (long long)LCK_MODE_NUM);
         CLASSERT(LDLM_PLAIN == 10);
         CLASSERT(LDLM_EXTENT == 11);
         CLASSERT(LDLM_FLOCK == 12);
@@ -578,8 +580,8 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_FL_TRUNCLOCK == (0x00000800));
         CLASSERT(OBD_FL_CKSUM_CRC32 == (0x00001000));
         CLASSERT(OBD_FL_CKSUM_ADLER == (0x00002000));
-        CLASSERT(OBD_CKSUM_CRC32 == OBD_CKSUM_CRC32);
-        CLASSERT(OBD_CKSUM_ADLER == OBD_CKSUM_ADLER);
+        CLASSERT(OBD_CKSUM_CRC32 == 1);
+        CLASSERT(OBD_CKSUM_ADLER == 2);
 
         /* Checks for struct lov_mds_md_v1 */
         LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
@@ -2089,6 +2091,7 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct lustre_disk_data, ldd_params));
         LASSERTF((int)sizeof(((struct lustre_disk_data *)0)->ldd_params) == 4096, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_disk_data *)0)->ldd_params));
+#ifdef LIBLUSTRE_POSIX_ACL
 
         /* Checks for type posix_acl_xattr_entry */
         LASSERTF((int)sizeof(xattr_acl_entry) == 8, " found %lld\n",
@@ -2117,5 +2120,6 @@ void lustre_assert_wire_constants(void)
                  (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));
+#endif
 }
 
index 98c9085..23b8df4 100644 (file)
@@ -14,7 +14,8 @@ sbin_scripts = lrun
 bin_scripts = llstat llobdstat plot-llstat llbackup
 
 if UTILS
-noinst_PROGRAMS = wirecheck obdio obdbarrier
+noinst_PROGRAMS = obdio obdbarrier
+EXTRA_PROGRAMS = wirecheck
 
 # mount only finds helpers in /sbin
 rootsbin_PROGRAMS = mount.lustre
@@ -102,7 +103,7 @@ EXTRA_DIST = $(sbin_scripts) $(bin_scripts)
 # NOTE: this should only be run on i386.
 newwiretest: wirehdr.c wirecheck
        cp wirehdr.c wiretest.c
-       ./wirecheck >> wiretest.c
+       LANG=C ./wirecheck >> wiretest.c
        cp ../ptlrpc/wirehdr.c ../ptlrpc/wiretest.c
-       ./wirecheck >> ../ptlrpc/wiretest.c
+       LANG=C ./wirecheck >> ../ptlrpc/wiretest.c
 
index bd8aa1a..d5d2d09 100644 (file)
@@ -266,8 +266,8 @@ check_obdo(void)
         CHECK_CDEFINE(OBD_FL_TRUNCLOCK);
         CHECK_CDEFINE(OBD_FL_CKSUM_CRC32);
         CHECK_CDEFINE(OBD_FL_CKSUM_ADLER);
-        CHECK_CDEFINE(OBD_CKSUM_CRC32);
-        CHECK_CDEFINE(OBD_CKSUM_ADLER);
+        CHECK_CVALUE(OBD_CKSUM_CRC32);
+        CHECK_CVALUE(OBD_CKSUM_ADLER);
 }
 
 static void
@@ -1010,7 +1010,6 @@ check_lustre_disk_data(void)
         CHECK_MEMBER(lustre_disk_data, ldd_params);
 }
 
-#ifdef LIBLUSTRE_POSIX_ACL
 static void
 check_posix_acl_xattr_entry(void)
 {
@@ -1029,7 +1028,6 @@ check_posix_acl_xattr_header(void)
         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
 }
-#endif
 
 static void
 system_string (char *cmdline, char *str, int len)
@@ -1094,7 +1092,7 @@ main(int argc, char **argv)
         printf ("void lustre_assert_wire_constants(void)\n"
                 "{\n"
                 "        /* Wire protocol assertions generated by 'wirecheck'\n"
-                "         * (make -C lustre/utils newwirecheck)\n"
+                "         * (make -C lustre/utils newwiretest)\n"
                 "         * running on %s\n"
                 "         * with %s */\n"
                 "\n", unameinfo, gccinfo);
@@ -1197,6 +1195,7 @@ main(int argc, char **argv)
         CHECK_VALUE(LCK_NL);
         CHECK_VALUE(LCK_GROUP);
         CHECK_VALUE(LCK_MAXMODE);
+        CHECK_VALUE(LCK_MODE_NUM);
 
         CHECK_CVALUE(LDLM_PLAIN);
         CHECK_CVALUE(LDLM_EXTENT);
@@ -1275,10 +1274,13 @@ main(int argc, char **argv)
         check_qunit_data_old();
         check_mgs_target_info();
         check_lustre_disk_data();
-#ifdef LIBLUSTRE_POSIX_ACL
+        printf("#ifdef LIBLUSTRE_POSIX_ACL\n");
+#ifndef LIBLUSTRE_POSIX_ACL
+#error build generator without LIBLUSTRE_POSIX_ACL defined - produce wrong check code.
+#endif
         check_posix_acl_xattr_entry();
         check_posix_acl_xattr_header();
-#endif
+        printf("#endif\n");
 
 
         printf("}\n\n");
index 22c6f2b..a8af0a7 100644 (file)
@@ -27,9 +27,9 @@ int main()
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
-         * (make -C lustre/utils newwirecheck)
-         * running on Linux rhel5.vbox 2.6.18-prep #1 SMP Fri Feb 22 14:24:02 EET 2008 i686 i686 i386
-         * with gcc version 4.1.2 20070626 (Red Hat 4.1.2-14) */
+         * (make -C lustre/utils newwiretest)
+         * running on Linux xlab.hostel 2.6.23.15-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i68
+         * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-7) */
 
 
         /* Constants... */
@@ -199,6 +199,8 @@ void lustre_assert_wire_constants(void)
                  (long long)LCK_GROUP);
         LASSERTF(LCK_MAXMODE == 65, " found %lld\n",
                  (long long)LCK_MAXMODE);
+        LASSERTF(LCK_MODE_NUM == 7, " found %lld\n",
+                 (long long)LCK_MODE_NUM);
         CLASSERT(LDLM_PLAIN == 10);
         CLASSERT(LDLM_EXTENT == 11);
         CLASSERT(LDLM_FLOCK == 12);
@@ -576,8 +578,8 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_FL_TRUNCLOCK == (0x00000800));
         CLASSERT(OBD_FL_CKSUM_CRC32 == (0x00001000));
         CLASSERT(OBD_FL_CKSUM_ADLER == (0x00002000));
-        CLASSERT(OBD_CKSUM_CRC32 == OBD_CKSUM_CRC32);
-        CLASSERT(OBD_CKSUM_ADLER == OBD_CKSUM_ADLER);
+        CLASSERT(OBD_CKSUM_CRC32 == 1);
+        CLASSERT(OBD_CKSUM_ADLER == 2);
 
         /* Checks for struct lov_mds_md_v1 */
         LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
@@ -2087,6 +2089,7 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct lustre_disk_data, ldd_params));
         LASSERTF((int)sizeof(((struct lustre_disk_data *)0)->ldd_params) == 4096, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_disk_data *)0)->ldd_params));
+#ifdef LIBLUSTRE_POSIX_ACL
 
         /* Checks for type posix_acl_xattr_entry */
         LASSERTF((int)sizeof(xattr_acl_entry) == 8, " found %lld\n",
@@ -2115,5 +2118,6 @@ void lustre_assert_wire_constants(void)
                  (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));
+#endif
 }