ceph: include the initial ACL in create/mkdir/mknod MDS requests
Current code set new file/directory's initial ACL in a non-atomic manner. Client first sends request to MDS to create new file/directory, then set the initial ACL after the new file/directory is successfully created. The fix is include the initial ACL in create/mkdir/mknod MDS requests. So MDS can handle creating file/directory and setting the initial ACL in one request. Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
@@ -733,15 +733,23 @@ extern void __ceph_build_xattrs_blob(struct ceph_inode_info *ci);
|
||||
extern void __ceph_destroy_xattrs(struct ceph_inode_info *ci);
|
||||
extern void __init ceph_xattr_init(void);
|
||||
extern void ceph_xattr_exit(void);
|
||||
extern const struct xattr_handler *ceph_xattr_handlers[];
|
||||
|
||||
/* acl.c */
|
||||
extern const struct xattr_handler *ceph_xattr_handlers[];
|
||||
struct ceph_acls_info {
|
||||
void *default_acl;
|
||||
void *acl;
|
||||
struct ceph_pagelist *pagelist;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_CEPH_FS_POSIX_ACL
|
||||
|
||||
struct posix_acl *ceph_get_acl(struct inode *, int);
|
||||
int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type);
|
||||
int ceph_init_acl(struct dentry *, struct inode *, struct inode *);
|
||||
int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
|
||||
struct ceph_acls_info *info);
|
||||
void ceph_init_inode_acls(struct inode *inode, struct ceph_acls_info *info);
|
||||
void ceph_release_acls_info(struct ceph_acls_info *info);
|
||||
|
||||
static inline void ceph_forget_all_cached_acls(struct inode *inode)
|
||||
{
|
||||
@@ -753,12 +761,18 @@ static inline void ceph_forget_all_cached_acls(struct inode *inode)
|
||||
#define ceph_get_acl NULL
|
||||
#define ceph_set_acl NULL
|
||||
|
||||
static inline int ceph_init_acl(struct dentry *dentry, struct inode *inode,
|
||||
struct inode *dir)
|
||||
static inline int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
|
||||
struct ceph_acls_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ceph_init_inode_acls(struct inode *inode,
|
||||
struct ceph_acls_info *info)
|
||||
{
|
||||
}
|
||||
static inline void ceph_release_acls_info(struct ceph_acls_info *info)
|
||||
{
|
||||
}
|
||||
static inline int ceph_acl_chmod(struct dentry *dentry, struct inode *inode)
|
||||
{
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user