Whamcloud - gitweb
LU-2335 build: stop checking for XATTR_ACL_SIZE
authorPeng Tao <tao.peng@emc.com>
Wed, 31 Oct 2012 06:51:02 +0000 (14:51 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 11 Jun 2013 16:06:37 +0000 (12:06 -0400)
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 <tao.peng@emc.com>
Change-Id: I64584f04055b06f26e1c08f834d4683f97841332
Reviewed-on: http://review.whamcloud.com/4644
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_acl.h

index d769124..31e83bf 100644 (file)
@@ -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 <linux/types.h>
-        #undef __KERNEL__
-        // block include
-        #define __LINUX_POSIX_ACL_H
-
-        #ifdef CONFIG_FS_POSIX_ACL
-        # include <linux/posix_acl_xattr.h>
-        #endif
-
-        #include <stdio.h>
-
-        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
index 3a3029d..e7df7f1 100644 (file)
 # include <linux/dcache.h>
 # ifdef CONFIG_FS_POSIX_ACL
 #  include <linux/posix_acl_xattr.h>
-#  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 <linux/lustre_intent.h>
 # include <linux/xattr.h> /* XATTR_{REPLACE,CREATE} */