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
+ #define posix_acl_xattr_entry xattr_acl_entry
+ #define posix_acl_xattr_header xattr_acl_header
+ #define posix_acl_xattr_size(entry) xattr_acl_size(entry)
+ #ifndef CONFIG_FS_POSIX_ACL
+ #define CONFIG_FS_POSIX_ACL 1
+ #endif
+#endif
+
#ifndef ENOTSUPP
#define ENOTSUPP ENOTSUP
#endif
# endif /* HAVE_XATTR_ACL */
# define LUSTRE_POSIX_ACL_MAX_ENTRIES (32)
-
-# ifdef __KERNEL__
# define LUSTRE_POSIX_ACL_MAX_SIZE \
(mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES))
-# else /* __KERNEL__ */
-# define LUSTRE_POSIX_ACL_MAX_SIZE 0
-# endif /* __KERNEL__ */
-
#else /* CONFIG_FS_POSIX_ACL */
# define LUSTRE_POSIX_ACL_MAX_SIZE 0
#endif /* CONFIG_FS_POSIX_ACL */
GOTO(out_cleanup, rc = -ENOMEM);
ocd->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_AT;
+#ifdef LIBLUSTRE_POSIX_ACL
+ ocd->ocd_connect_flags |= OBD_CONNECT_ACL;
+#endif
ocd->ocd_version = LUSTRE_VERSION_CODE;
rc = obd_connect(&mgc_conn, obd, &mgc_uuid, ocd, NULL);
ocd.ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_VERSION |
OBD_CONNECT_AT;
+#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;
/* fetch attr of root inode */
err = mdc_getattr(sbi->ll_mdc_exp, &rootfid,
- OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS, 0, &request);
+ OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS, 0,
+ &request);
if (err) {
CERROR("mdc_getattr failed for root: rc = %d\n", err);
GOTO(out_osc, err);
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)
}
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);
+}
+
+static void
system_string (char *cmdline, char *str, int len)
{
int fds[2];
check_qunit_data_old();
check_mgs_target_info();
check_lustre_disk_data();
+ check_posix_acl_xattr_entry();
+ check_posix_acl_xattr_header();
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));
+
+ /* 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));
+
+ /* 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));
+
}