#include <linux/stat.h>
#include <linux/mount.h>
#include <linux/backing-dev.h>
-#include <linux/posix_acl_xattr.h>
#ifndef HAVE_FILE_DENTRY
static inline struct dentry *file_dentry(const struct file *file)
#define DTTOIF(dirtype) ((dirtype) << IFSHIFT)
#endif
-#ifndef HAVE_POSIXACL_USER_NS
-/*
- * Mask out &init_user_ns so we don't jump
- * through hoops to define it somehow only
- * to have it ignored anyway.
- */
-#define posix_acl_from_xattr(a,b,c) posix_acl_from_xattr(b,c)
-#define posix_acl_to_xattr(a,b,c,d) posix_acl_to_xattr(b,c,d)
-#endif
-
-#ifndef HAVE_POSIX_ACL_VALID_USER_NS
-#define posix_acl_valid(a,b) posix_acl_valid(b)
-#endif
#endif
])])
]) # LC_QUOTA_CONFIG
+
+#[AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])])
+#
+# LC_POSIX_ACL_CONFIG
+#
+# POSIX ACL support.
+#
+AC_DEFUN([LC_POSIX_ACL_CONFIG], [
+LB_CHECK_CONFIG_IM([FS_POSIX_ACL],
+ [AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])
+], [ ])
+]) # LC_POSIX_ACL_CONFIG
+
+LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
+ [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
+
#
# LC_CONFIG_GSS_KEYRING
#
LC_STACK_SIZE
LC_QUOTA_CONFIG
])
+ LC_POSIX_ACL_CONFIG
]) # LC_PROG_LINUX
#
#include <linux/fs.h>
#include <linux/dcache.h>
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
# include <linux/posix_acl_xattr.h>
# define LUSTRE_POSIX_ACL_MAX_ENTRIES 32
# define LUSTRE_POSIX_ACL_MAX_SIZE_OLD \
(sizeof(posix_acl_xattr_header) + \
LUSTRE_POSIX_ACL_MAX_ENTRIES * sizeof(posix_acl_xattr_entry))
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
#ifndef LUSTRE_POSIX_ACL_MAX_SIZE_OLD
# define LUSTRE_POSIX_ACL_MAX_SIZE_OLD 0
#include <linux/fs_struct.h>
#include <linux/namei.h>
#include <linux/pagemap.h>
+#include <linux/posix_acl_xattr.h>
#include <linux/bio.h>
#include <linux/xattr.h>
#include <linux/workqueue.h>
}
#endif /* HAVE_VFS_SETXATTR */
+#ifndef HAVE_POSIXACL_USER_NS
+/*
+ * Mask out &init_user_ns so we don't jump
+ * through hoops to define it somehow only
+ * to have it ignored anyway.
+ */
+#define posix_acl_from_xattr(a, b, c) posix_acl_from_xattr(b, c)
+#define posix_acl_to_xattr(a, b, c, d) posix_acl_to_xattr(b, c, d)
+#endif
+
+#ifndef HAVE_POSIX_ACL_VALID_USER_NS
+#define posix_acl_valid(a,b) posix_acl_valid(b)
+#endif
+
#ifdef HAVE_IOP_SET_ACL
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
#ifndef HAVE_POSIX_ACL_UPDATE_MODE
static inline int posix_acl_update_mode(struct inode *inode, umode_t *mode_p,
struct posix_acl **acl)
* @{
*/
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
# include <linux/fs.h>
-# include <linux/posix_acl_xattr.h>
+# include <lustre_compat.h>
typedef struct {
__u16 e_tag;
extern int lustre_posix_acl_equiv_mode(posix_acl_xattr_entry *entry, mode_t *mode_p,
int count);
#endif /* HAVE_SERVER_SUPPORT */
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
/** @} eacl */
#include <linux/fs.h>
#include <linux/dcache.h>
-#ifdef CONFIG_FS_POSIX_ACL
-# include <linux/posix_acl_xattr.h>
-#endif /* CONFIG_FS_POSIX_ACL */
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
+# include <lustre_compat.h>
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
#include <lustre_handles.h>
#include <lustre_intent.h>
#include <libcfs/libcfs.h>
struct lmv_foreign_md *lfm;
};
struct lmv_stripe_md *default_lmv;
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
struct posix_acl *posix_acl;
#endif
};
}
#ifdef HAVE_IOP_SET_ACL
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
int ll_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
struct ll_sb_info *sbi = ll_i2sbi(inode);
set_cached_acl(inode, type, acl);
RETURN(rc);
}
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
#endif /* HAVE_IOP_SET_ACL */
int ll_inode_permission(struct inode *inode, int mask)
int ll_getattr_dentry(struct dentry *de, struct kstat *stat);
struct posix_acl *ll_get_acl(struct inode *inode, int type);
#ifdef HAVE_IOP_SET_ACL
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
int ll_set_acl(struct inode *inode, struct posix_acl *acl, int type);
-#else /* !CONFIG_FS_POSIX_ACL */
+#else /* !CONFIG_LUSTRE_FS_POSIX_ACL */
#define ll_set_acl NULL
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
#endif
int ll_migrate(struct inode *parent, struct file *file,
if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
#endif
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
data->ocd_connect_flags |= OBD_CONNECT_ACL | OBD_CONNECT_UMASK |
OBD_CONNECT_LARGE_ACL;
#endif
ptlrpc_req_finished(request);
if (IS_ERR(root)) {
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (lmd.posix_acl) {
posix_acl_release(lmd.posix_acl);
lmd.posix_acl = NULL;
ll_xattr_cache_destroy(inode);
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
forget_all_cached_acls(inode);
if (lli->lli_posix_acl) {
posix_acl_release(lli->lli_posix_acl);
return rc;
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (body->mbo_valid & OBD_MD_FLACL) {
spin_lock(&lli->lli_lock);
if (lli->lli_posix_acl)
sbi->ll_flags & LL_SBI_32BIT_API),
&md);
if (IS_ERR(*inode)) {
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (md.posix_acl) {
posix_acl_release(md.posix_acl);
md.posix_acl = NULL;
if (test_xattr_is_selinux_disabled(handler, name))
RETURN(-EOPNOTSUPP);
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
/* posix acl is under protection of LOOKUP lock. when calling to this,
* we just have path resolution to the target inode, so we have great
* chance that cached ACL is uptodate.
&ll_user_xattr_handler,
&ll_trusted_xattr_handler,
&ll_security_xattr_handler,
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
&ll_acl_access_xattr_handler,
&ll_acl_default_xattr_handler,
#endif
return rc;
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
static int mdc_unpack_acl(struct ptlrpc_request *req, struct lustre_md *md)
{
struct req_capsule *pill = &req->rq_pill;
rc = mdc_unpack_acl(req, md);
if (rc)
GOTO(out, rc);
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
} else {
md->posix_acl = NULL;
#endif
EXIT;
out:
if (rc) {
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
posix_acl_release(md->posix_acl);
#endif
}
if (rc)
GOTO(out, rc);
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (def_acl_buf && def_acl_buf->lb_len > 0 && S_ISDIR(attr->la_mode)) {
/* if dir, then can inherit default ACl */
rc = mdo_declare_xattr_set(env, c, def_acl_buf,
GOTO(err_destroy, rc);
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (def_acl_buf != NULL && def_acl_buf->lb_len > 0 &&
S_ISDIR(attr->la_mode)) {
/* set default acl */
ENTRY;
rc = mdo_attr_set(env, obj, attr, handle);
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (!rc && (attr->la_valid & LA_MODE) && needacl)
rc = mdd_acl_chmod(env, obj, attr->la_mode, handle);
#endif
if (rc)
return rc;
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (attr->la_valid & LA_MODE) {
mdd_read_lock(env, obj, DT_TGT_CHILD);
rc = mdo_xattr_get(env, obj, &LU_BUF_NULL,
#include <lustre_idmap.h>
#include "mdd_internal.h"
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
/*
* Hold write_lock for o.
static int mdd_check_acl(const struct lu_env *env, struct mdd_object *obj,
const struct lu_attr *la, int mask)
{
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
struct lu_ucred *uc = lu_ucred_assert(env);
posix_acl_xattr_header *head;
posix_acl_xattr_entry *entry;
RETURN(0);
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
/*
* Pack ACL data into the reply. UIDs/GIDs are mapped and filtered by nodemap.
*
GOTO(out, rc = rc2);
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (need & MA_ACL_DEF && S_ISDIR(mode)) {
buf->lb_buf = ma->ma_acl;
buf->lb_len = ma->ma_acl_size;
repbody->mbo_max_mdsize);
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if ((exp_connect_flags(req->rq_export) & OBD_CONNECT_ACL) &&
(reqbody->mbo_valid & OBD_MD_FLACL)) {
struct lu_nodemap *nodemap = nodemap_get_from_exp(exp);
int mdt_reint_unpack(struct mdt_thread_info *info, __u32 op);
void mdt_fix_lov_magic(struct mdt_thread_info *info, void *eadata);
int mdt_reint_rec(struct mdt_thread_info *, struct mdt_lock_handle *);
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
int mdt_pack_acl2body(struct mdt_thread_info *info, struct mdt_body *repbody,
struct mdt_object *o, struct lu_nodemap *nodemap);
#endif
RETURN(-ENOENT);
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if (exp_connect_flags(exp) & OBD_CONNECT_ACL) {
struct lu_nodemap *nodemap = nodemap_get_from_exp(exp);
if (IS_ERR(nodemap))
# include <md_object.h>
#endif /* HAVE_SERVER_SUPPORT */
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
static inline void lustre_posix_acl_le_to_cpu(posix_acl_xattr_entry *d,
posix_acl_xattr_entry *s)
}
}
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
if ((ma->ma_need & MA_ACL_DEF) && S_ISDIR(mode)) {
buf->lb_buf = ma->ma_acl;
buf->lb_len = ma->ma_acl_size;
#define DEBUG_SUBSYSTEM S_RPC
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
# include <linux/fs.h>
# include <linux/posix_acl_xattr.h>
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
#include <obd_support.h>
#include <obd_class.h>
#define DEBUG_SUBSYSTEM S_RPC
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
# include <linux/fs.h>
# include <linux/posix_acl_xattr.h>
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
#include <obd_support.h>
#include <obd_class.h>
CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_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));
(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));
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
/* 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)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n",
(long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
#endif /* HAVE_STRUCT_POSIX_ACL_XATTR */
-#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
/* Checks for struct link_ea_header */
LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",