From 8d43b9c3900424e39b00ce3f5af38587179b328c Mon Sep 17 00:00:00 2001 From: deen <deen> Date: Tue, 24 Jun 2008 13:47:58 +0000 Subject: [PATCH] Update an obsolete wirecheck.c generator. b=15566 i=adilger i=shadow --- lustre/autoconf/lustre-core.m4 | 5 +---- lustre/ptlrpc/wiretest.c | 14 +++++++++----- lustre/utils/Makefile.am | 7 ++++--- lustre/utils/wirecheck.c | 16 +++++++++------- lustre/utils/wiretest.c | 14 +++++++++----- 5 files changed, 32 insertions(+), 24 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index a80ce8a778..493a35a36f 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 3ecb7cf939..bb2db8c597 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -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 } diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am index 98c9085dc4..23b8df410e 100644 --- a/lustre/utils/Makefile.am +++ b/lustre/utils/Makefile.am @@ -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 diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index bd8aa1af86..d5d2d097e8 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -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"); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 22c6f2b73c..a8af0a7069 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -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 } -- GitLab