Commit 271bf66d authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

Pull some further ceph acl cleanups from Sage Weil:
 "I do have a couple patches on top of what's in your tree, though, that
  clean up a couple duplicated lines in your fix and apply Christoph's
  cleanup"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: simplify ceph_{get,init}_acl
  ceph: remove duplicate declaration of ceph_setattr
parents aa2e7100 75858236
...@@ -66,13 +66,6 @@ struct posix_acl *ceph_get_acl(struct inode *inode, int type) ...@@ -66,13 +66,6 @@ struct posix_acl *ceph_get_acl(struct inode *inode, int type)
char *value = NULL; char *value = NULL;
struct posix_acl *acl; struct posix_acl *acl;
if (!IS_POSIXACL(inode))
return NULL;
acl = ceph_get_cached_acl(inode, type);
if (acl != ACL_NOT_CACHED)
return acl;
switch (type) { switch (type) {
case ACL_TYPE_ACCESS: case ACL_TYPE_ACCESS:
name = POSIX_ACL_XATTR_ACCESS; name = POSIX_ACL_XATTR_ACCESS;
...@@ -190,41 +183,24 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) ...@@ -190,41 +183,24 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type)
int ceph_init_acl(struct dentry *dentry, struct inode *inode, struct inode *dir) int ceph_init_acl(struct dentry *dentry, struct inode *inode, struct inode *dir)
{ {
struct posix_acl *acl = NULL; struct posix_acl *default_acl, *acl;
int ret = 0; int error;
if (!S_ISLNK(inode->i_mode)) {
if (IS_POSIXACL(dir)) {
acl = ceph_get_acl(dir, ACL_TYPE_DEFAULT);
if (IS_ERR(acl)) {
ret = PTR_ERR(acl);
goto out;
}
}
if (!acl) error = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl);
inode->i_mode &= ~current_umask(); if (error)
} return error;
if (IS_POSIXACL(dir) && acl) { if (!default_acl && !acl)
if (S_ISDIR(inode->i_mode)) {
ret = ceph_set_acl(inode, acl, ACL_TYPE_DEFAULT);
if (ret)
goto out_release;
}
ret = __posix_acl_create(&acl, GFP_NOFS, &inode->i_mode);
if (ret < 0)
goto out;
else if (ret > 0)
ret = ceph_set_acl(inode, acl, ACL_TYPE_ACCESS);
else
cache_no_acl(inode);
} else {
cache_no_acl(inode); cache_no_acl(inode);
}
out_release: if (default_acl) {
posix_acl_release(acl); error = ceph_set_acl(inode, default_acl, ACL_TYPE_DEFAULT);
out: posix_acl_release(default_acl);
return ret; }
if (acl) {
if (!error)
error = ceph_set_acl(inode, acl, ACL_TYPE_ACCESS);
posix_acl_release(acl);
}
return error;
} }
...@@ -718,7 +718,6 @@ extern void ceph_queue_writeback(struct inode *inode); ...@@ -718,7 +718,6 @@ extern void ceph_queue_writeback(struct inode *inode);
extern int ceph_do_getattr(struct inode *inode, int mask); extern int ceph_do_getattr(struct inode *inode, int mask);
extern int ceph_permission(struct inode *inode, int mask); extern int ceph_permission(struct inode *inode, int mask);
extern int ceph_setattr(struct dentry *dentry, struct iattr *attr); extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry, extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat); struct kstat *stat);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment