From 07977bbea8be60e38a0c25662633c9b64906a794 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Wed, 31 Oct 2012 14:51:02 +0800 Subject: [PATCH] LU-2335 build: stop checking for XATTR_ACL_SIZE posix_acl_xattr_size() never changed in all kernels, liblustre also implements the same as in kernel. So XATTR_ACL_SIZE can be calculated at compile time and doesn't need to be checked. Removing it can reduce parameters that need to exist in Kconfig. Signed-off-by: Peng Tao Change-Id: I64584f04055b06f26e1c08f834d4683f97841332 Reviewed-on: http://review.whamcloud.com/4644 Reviewed-by: Andreas Dilger Tested-by: Hudson Tested-by: Maloo Reviewed-by: Fan Yong --- lustre/autoconf/lustre-core.m4 | 45 --------------------------------------- lustre/include/linux/lustre_acl.h | 5 ++++- 2 files changed, 4 insertions(+), 46 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index d769124..31e83bf 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -314,49 +314,6 @@ AC_DEFUN([LC_BIT_SPINLOCK_H], ]) # -# LC_CONST_ACL_SIZE -# -AC_DEFUN([LC_CONST_ACL_SIZE], -[AC_MSG_CHECKING([calc acl size]) -tmp_flags="$CFLAGS" -CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -include $AUTOCONF_HDIR/autoconf.h $EXTRA_KCFLAGS" -AC_TRY_RUN([ - #define __KERNEL__ - #include - #undef __KERNEL__ - // block include - #define __LINUX_POSIX_ACL_H - - #ifdef CONFIG_FS_POSIX_ACL - # include - #endif - - #include - - int main(void) - { - /* LUSTRE_POSIX_ACL_MAX_ENTRIES = 32 */ - int size = posix_acl_xattr_size(32); - FILE *f = fopen("acl.size","w+"); - fprintf(f,"%d", size); - fclose(f); - - return 0; - } -],[ - acl_size=`cat acl.size` - AC_MSG_RESULT([ACL size $acl_size]) - AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl]) -],[ - AC_ERROR([ACL size can't be computed]) -],[ - AC_MSG_RESULT([can't check ACL size, make it 260]) - AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE,260) -]) -CFLAGS="$tmp_flags" -]) - -# # LC_CAPA_CRYPTO # AC_DEFUN([LC_CAPA_CRYPTO], @@ -2274,8 +2231,6 @@ AC_DEFUN([LC_PROG_LINUX], LC_FILEMAP_POPULATE LC_BIT_SPINLOCK_H - LC_CONST_ACL_SIZE - LC_CAPA_CRYPTO LC_CONFIG_RMTCLIENT LC_CONFIG_GSS diff --git a/lustre/include/linux/lustre_acl.h b/lustre/include/linux/lustre_acl.h index 3a3029d..e7df7f1 100644 --- a/lustre/include/linux/lustre_acl.h +++ b/lustre/include/linux/lustre_acl.h @@ -52,7 +52,10 @@ # include # ifdef CONFIG_FS_POSIX_ACL # include -# define LUSTRE_POSIX_ACL_MAX_SIZE XATTR_ACL_SIZE +# 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)) # endif /* CONFIG_FS_POSIX_ACL */ # include # include /* XATTR_{REPLACE,CREATE} */ -- 1.8.3.1