])
#
-# After 2.6.26 we no longer have xattr_acl.h
+# LC_CONST_ACL_SIZE
#
-AC_DEFUN([LC_XATTR_ACL],
-[LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
- AC_MSG_CHECKING([if xattr_acl.h can be compiled])
- LB_LINUX_TRY_COMPILE([
- #include <linux/xattr_acl.h>
- ],[],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
- ],[
- AC_MSG_RESULT([no])
- ])
-],
-[])
-])
-
-#
-# After 2.6.16 the xattr_acl API is removed, and posix_acl is used instead
-#
-AC_DEFUN([LC_POSIX_ACL_XATTR_H],
-[LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
- AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
- LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include <linux/posix_acl_xattr.h>
- ],[],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
-
- ],[
- AC_MSG_RESULT([no])
- ])
-$1
-],[
- AC_MSG_RESULT([no])
-])
-])
-
AC_DEFUN([LC_CONST_ACL_SIZE],
[AC_MSG_CHECKING([calc acl size])
tmp_flags="$CFLAGS"
// block include
#define __LINUX_POSIX_ACL_H
- # ifdef CONFIG_FS_POSIX_ACL
- # ifdef HAVE_XATTR_ACL
- # include <linux/xattr_acl.h>
- # endif
- # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
- # include <linux/posix_acl_xattr.h>
- # endif
- # endif
-
- #include <lustre_acl.h>
+ #ifdef CONFIG_FS_POSIX_ACL
+ # include <linux/posix_acl_xattr.h>
+ #endif
#include <stdio.h>
int main(void)
{
- int size = mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES);
+ /* 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);
LC_D_ADD_UNIQUE
LC_BIT_SPINLOCK_H
- LC_XATTR_ACL
- LC_POSIX_ACL_XATTR_H
LC_CONST_ACL_SIZE
LC_STRUCT_INTENT_FILE
#define NO_QUOTA 1
/* ACL */
-struct posix_acl_entry {
- short e_tag;
- unsigned short e_perm;
- unsigned int e_id;
-};
-
-struct posix_acl {
- cfs_atomic_t a_refcount;
- unsigned int a_count;
- struct posix_acl_entry a_entries[0];
-};
-
typedef struct {
__u16 e_tag;
__u16 e_perm;
__u32 e_id;
-} xattr_acl_entry;
+} posix_acl_xattr_entry;
+
+struct posix_acl {
+ cfs_atomic_t a_refcount;
+ unsigned int a_count;
+ posix_acl_xattr_entry a_entries[0];
+};
typedef struct {
- __u32 a_version;
- xattr_acl_entry a_entries[0];
-} xattr_acl_header;
+ __u32 a_version;
+ posix_acl_xattr_entry a_entries[0];
+} posix_acl_xattr_header;
-static inline size_t xattr_acl_size(int count)
+static inline size_t posix_acl_xattr_size(int count)
{
- return sizeof(xattr_acl_header) + count * sizeof(xattr_acl_entry);
+ return sizeof(posix_acl_xattr_header) + count *
+ sizeof(posix_acl_xattr_entry);
}
static inline
{
}
-#ifdef LIBLUSTRE_POSIX_ACL
-# 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
+#if defined(LIBLUSTRE_POSIX_ACL) && !defined(CONFIG_FS_POSIX_ACL)
+# define CONFIG_FS_POSIX_ACL 1
#endif
#ifndef ENOTSUPP
* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2012 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
# include <linux/fs.h>
# include <linux/dcache.h>
# ifdef CONFIG_FS_POSIX_ACL
-# ifdef HAVE_XATTR_ACL
-# include <linux/xattr_acl.h>
-# endif /* HAVE_XATTR_ACL */
-# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-# include <linux/posix_acl_xattr.h>
-# endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
+# include <linux/posix_acl_xattr.h>
+# define LUSTRE_POSIX_ACL_MAX_SIZE XATTR_ACL_SIZE
# endif /* CONFIG_FS_POSIX_ACL */
-#include <linux/lustre_intent.h>
-/* XATTR_{REPLACE,CREATE} */
-#include <linux/xattr.h>
+# include <linux/lustre_intent.h>
+# include <linux/xattr.h> /* XATTR_{REPLACE,CREATE} */
#endif /* __KERNEL__ */
-/* ACL */
-#ifdef CONFIG_FS_POSIX_ACL
-# ifdef HAVE_XATTR_ACL
-# define MDS_XATTR_NAME_ACL_ACCESS XATTR_NAME_ACL_ACCESS
-# define mds_xattr_acl_size(entry) xattr_acl_size(entry)
-# else /* HAVE_XATTR_ACL */
-# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-# define MDS_XATTR_NAME_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
-# define mds_xattr_acl_size(entry) posix_acl_xattr_size(entry)
-# endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
-# endif /* HAVE_XATTR_ACL */
-
-# define LUSTRE_POSIX_ACL_MAX_ENTRIES (32)
-
-#ifdef __KERNEL__
-# define LUSTRE_POSIX_ACL_MAX_SIZE XATTR_ACL_SIZE
-#else
+#ifndef LUSTRE_POSIX_ACL_MAX_SIZE
# define LUSTRE_POSIX_ACL_MAX_SIZE 0
#endif
-# else /* CONFIG_FS_POSIX_ACL */
-# define LUSTRE_POSIX_ACL_MAX_SIZE 0
-# endif /* CONFIG_FS_POSIX_ACL */
-
#endif /* _LUSTRE_LINUX_ACL_H */
* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2012 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
# include <linux/fs.h>
# include <linux/dcache.h>
# ifdef CONFIG_FS_POSIX_ACL
-# ifdef HAVE_XATTR_ACL
-# include <linux/xattr_acl.h>
-# endif /* HAVE_XATTR_ACL */
-# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-# include <linux/posix_acl_xattr.h>
-# endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
+# include <linux/posix_acl_xattr.h>
# endif /* CONFIG_FS_POSIX_ACL */
# include <linux/lustre_intent.h>
#endif /* __KERNEL__ */
* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2012 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
#ifdef CONFIG_FS_POSIX_ACL
-# ifdef HAVE_XATTR_ACL
-# include <linux/xattr_acl.h>
-# endif /* HAVE_XATTR_ACL */
-# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-# include <linux/posix_acl_xattr.h>
-# endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
+#include <linux/posix_acl_xattr.h>
#include <lustre_idmap.h>
#include <md_object.h>
* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2012 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
# include <linux/fs.h>
# include <linux/dcache.h>
# ifdef CONFIG_FS_POSIX_ACL
-# ifdef HAVE_XATTR_ACL
-# include <linux/xattr_acl.h>
-# endif /*HAVE_XATTR_ACL */
-# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-# include <linux/posix_acl_xattr.h>
-# endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
+# include <linux/posix_acl_xattr.h>
# endif /* CONFIG_FS_POSIX_ACL */
-#include <linux/lustre_intent.h>
+# include <linux/lustre_intent.h>
#endif /* __KERNEL__ */
#include <lustre_handles.h>
#include <libcfs/libcfs.h>
# endif
# ifdef CONFIG_FS_POSIX_ACL
# include <linux/fs.h>
-# ifdef HAVE_XATTR_ACL
-# include <linux/xattr_acl.h>
-# else
-# define xattr_acl_entry posix_acl_xattr_entry
-# define xattr_acl_header posix_acl_xattr_header
-# endif
-# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-# include <linux/posix_acl_xattr.h>
-# endif
+# include <linux/posix_acl_xattr.h>
# endif
#endif
# endif
# ifdef CONFIG_FS_POSIX_ACL
# include <linux/fs.h>
-# ifdef HAVE_XATTR_ACL
-# include <linux/xattr_acl.h>
-# else
-# define xattr_acl_entry posix_acl_xattr_entry
-# define xattr_acl_header posix_acl_xattr_header
-# endif
-# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-# include <linux/posix_acl_xattr.h>
-# endif
+# include <linux/posix_acl_xattr.h>
# endif
#endif
#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
/* Checks for struct link_ea_header */
#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
/* Checks for struct link_ea_header */