fi
AC_MSG_RESULT([$enable_liblustre_tests])
+AC_MSG_CHECKING([whether to enable liblustre acl])
+AC_ARG_ENABLE([liblustre-acl],
+ AC_HELP_STRING([--disable-liblustre-acl],
+ [disable ACL support for liblustre]),
+ [],[enable_liblustre_acl=yes])
+if test x$enable_liblustre != xyes ; then
+ enable_liblustre_acl='no'
+fi
+AC_MSG_RESULT([$enable_liblustre_acl])
+if test x$enable_liblustre_acl != xno ; then
+ AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
+fi
+
AC_MSG_CHECKING([whether to build mpitests])
AC_ARG_ENABLE([mpitests],
AC_HELP_STRING([--enable-mpitests],
{
}
+#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
+#endif
+
#ifndef ENOTSUPP
#define ENOTSUPP ENOTSUP
#endif
GOTO(out_cleanup, rc = -ENOMEM);
ocd->ocd_connect_flags = OBD_CONNECT_VERSION;
+#ifdef LIBLUSTRE_POSIX_ACL
+ ocd->ocd_connect_flags |= OBD_CONNECT_ACL;
+#endif
ocd->ocd_version = LUSTRE_VERSION_CODE;
rc = obd_connect(NULL, &mgc_conn, obd, &mgc_uuid, ocd);
sizeof(async), &async, NULL);
ocd.ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_VERSION;
+#ifdef LIBLUSTRE_POSIX_ACL
+ ocd.ocd_connect_flags |= OBD_CONNECT_ACL;
+#endif
ocd.ocd_ibits_known = MDS_INODELOCK_FULL;
ocd.ocd_version = LUSTRE_VERSION_CODE;
CHECK_VALUE((int)offsetof(struct s, m)); \
} while(0)
+#define CHECK_MEMBER_OFFSET_TYPEDEF(s,m) \
+do { \
+ CHECK_VALUE((int)offsetof(s, m)); \
+} while(0)
+
#define CHECK_MEMBER_SIZEOF(s,m) \
do { \
CHECK_VALUE((int)sizeof(((struct s *)0)->m)); \
} while(0)
+#define CHECK_MEMBER_SIZEOF_TYPEDEF(s,m) \
+do { \
+ CHECK_VALUE((int)sizeof(((s *)0)->m)); \
+} while(0)
+
#define CHECK_MEMBER(s,m) \
do { \
CHECK_MEMBER_OFFSET(s, m); \
CHECK_MEMBER_SIZEOF(s, m); \
} while(0)
+#define CHECK_MEMBER_TYPEDEF(s,m) \
+do { \
+ CHECK_MEMBER_OFFSET_TYPEDEF(s, m); \
+ CHECK_MEMBER_SIZEOF_TYPEDEF(s, m); \
+} while(0)
+
#define CHECK_STRUCT(s) \
do { \
COMMENT("Checks for struct "#s); \
CHECK_VALUE((int)sizeof(struct s)); \
} while(0)
+#define CHECK_STRUCT_TYPEDEF(s) \
+do { \
+ COMMENT("Checks for type "#s); \
+ CHECK_VALUE((int)sizeof(s)); \
+} while(0)
static void
check_lustre_handle(void)
CHECK_MEMBER(lustre_disk_data, ldd_params);
}
+#ifdef LIBLUSTRE_POSIX_ACL
+static void
+check_posix_acl_xattr_entry(void)
+{
+ BLANK_LINE();
+ CHECK_STRUCT_TYPEDEF(posix_acl_xattr_entry);
+ CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_tag);
+ CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_perm);
+ CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_id);
+}
+
+static void
+check_posix_acl_xattr_header(void)
+{
+ BLANK_LINE();
+ CHECK_STRUCT_TYPEDEF(posix_acl_xattr_header);
+ 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)
{
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");
(long long)(int)offsetof(struct lustre_disk_data, ldd_params));
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(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(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
+
}