From 2211d5ba5c6c4e972ba6dbc912b2897425ea6621 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Tue, 27 Sep 2016 13:03:22 +0200 Subject: posix_acl: xattr representation cleanups Remove the unnecessary typedefs and the zero-length a_entries array in struct posix_acl_xattr_header. Signed-off-by: Andreas Gruenbacher Signed-off-by: Al Viro --- drivers/staging/lustre/lustre/include/lustre_acl.h | 6 +-- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 44 ++++++++++------------ 2 files changed, 23 insertions(+), 27 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/lustre/lustre/include/lustre_acl.h b/drivers/staging/lustre/lustre/include/lustre_acl.h index fecabe139b1f..9786f6caaade 100644 --- a/drivers/staging/lustre/lustre/include/lustre_acl.h +++ b/drivers/staging/lustre/lustre/include/lustre_acl.h @@ -38,8 +38,8 @@ #include #define LUSTRE_POSIX_ACL_MAX_ENTRIES 32 -#define LUSTRE_POSIX_ACL_MAX_SIZE \ - (sizeof(posix_acl_xattr_header) + \ - LUSTRE_POSIX_ACL_MAX_ENTRIES * sizeof(posix_acl_xattr_entry)) +#define LUSTRE_POSIX_ACL_MAX_SIZE \ + (sizeof(struct posix_acl_xattr_header) + \ + LUSTRE_POSIX_ACL_MAX_ENTRIES * sizeof(struct posix_acl_xattr_entry)) #endif diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c index 6cc2b2edf3fc..bcdf0f340083 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c +++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c @@ -3745,32 +3745,28 @@ void lustre_assert_wire_constants(void) CLASSERT(FIEMAP_EXTENT_NET == 0x80000000); /* 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)); + LASSERTF((int)sizeof(struct posix_acl_xattr_entry) == 8, "found %lld\n", + (long long)(int)sizeof(struct posix_acl_xattr_entry)); + LASSERTF((int)offsetof(struct posix_acl_xattr_entry, e_tag) == 0, "found %lld\n", + (long long)(int)offsetof(struct posix_acl_xattr_entry, e_tag)); + LASSERTF((int)sizeof(((struct posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n", + (long long)(int)sizeof(((struct posix_acl_xattr_entry *)0)->e_tag)); + LASSERTF((int)offsetof(struct posix_acl_xattr_entry, e_perm) == 2, "found %lld\n", + (long long)(int)offsetof(struct posix_acl_xattr_entry, e_perm)); + LASSERTF((int)sizeof(((struct posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n", + (long long)(int)sizeof(((struct posix_acl_xattr_entry *)0)->e_perm)); + LASSERTF((int)offsetof(struct posix_acl_xattr_entry, e_id) == 4, "found %lld\n", + (long long)(int)offsetof(struct posix_acl_xattr_entry, e_id)); + LASSERTF((int)sizeof(((struct posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct posix_acl_xattr_entry *)0)->e_id)); /* 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)); + LASSERTF((int)sizeof(struct posix_acl_xattr_header) == 4, "found %lld\n", + (long long)(int)sizeof(struct posix_acl_xattr_header)); + LASSERTF((int)offsetof(struct posix_acl_xattr_header, a_version) == 0, "found %lld\n", + (long long)(int)offsetof(struct posix_acl_xattr_header, a_version)); + LASSERTF((int)sizeof(((struct posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n", + (long long)(int)sizeof(((struct posix_acl_xattr_header *)0)->a_version)); /* Checks for struct link_ea_header */ LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n", -- cgit v1.2.3-55-g7522