From 2fb220f4b79a019b220799b6f961680c71386a5f Mon Sep 17 00:00:00 2001 From: bwzhou Date: Fri, 16 Nov 2007 03:24:21 +0000 Subject: [PATCH] Branch b1_6 b=13317 add #ifdef for wiretest and wirecheck to resolve building issues; minor fix for definitions of several macros in liblustre.h. --- lustre/include/liblustre.h | 12 ++++++++--- lustre/utils/wirecheck.c | 4 ++++ lustre/utils/wiretest.c | 50 ++++++++++++++++++++++++---------------------- 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 82436dd..d483374 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -904,9 +904,15 @@ void posix_acl_release(struct posix_acl *acl) } #ifdef LIBLUSTRE_POSIX_ACL - #define posix_acl_xattr_entry xattr_acl_entry - #define posix_acl_xattr_header xattr_acl_header - #define posix_acl_xattr_size(entry) xattr_acl_size(entry) + #ifndef posix_acl_xattr_entry + #define posix_acl_xattr_entry xattr_acl_entry + #endif + #ifndef posix_acl_xattr_header + #define posix_acl_xattr_header xattr_acl_header + #endif + #ifndef posix_acl_xattr_size + #define posix_acl_xattr_size(entry) xattr_acl_size(entry) + #endif #ifndef CONFIG_FS_POSIX_ACL #define CONFIG_FS_POSIX_ACL 1 #endif diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index e3e677f..c9e5593 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -1025,6 +1025,7 @@ check_lustre_disk_data(void) CHECK_MEMBER(lustre_disk_data, ldd_params); } +#ifdef LIBLUSTRE_POSIX_ACL static void check_posix_acl_xattr_entry(void) { @@ -1043,6 +1044,7 @@ 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) @@ -1293,8 +1295,10 @@ main(int argc, char **argv) check_qunit_data_old(); check_mgs_target_info(); check_lustre_disk_data(); +#ifdef LIBLUSTRE_POSIX_ACL check_posix_acl_xattr_entry(); check_posix_acl_xattr_header(); +#endif printf("}\n\n"); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index c0824d1..b2b832f 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -2141,32 +2141,34 @@ void lustre_assert_wire_constants(void) 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", - (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 } -- 1.8.3.1