Updated to 2.6.32.27
/fs/btrfs/acl.c
blob:12d7be8df561dfd93c0a3c86f7c6c7f44887dab8 -> blob:38ebe789b5628e9ddb6a5076b523612b5b988476
--- fs/btrfs/acl.c
+++ fs/btrfs/acl.c
@@ -94,8 +94,7 @@ static int btrfs_xattr_get_acl(struct in
/*
* Needs to be called with fs_mutex held
*/
-static int btrfs_set_acl(struct btrfs_trans_handle *trans,
- struct inode *inode, struct posix_acl *acl, int type)
+static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
int ret, size = 0;
const char *name;
@@ -112,14 +111,12 @@ static int btrfs_set_acl(struct btrfs_tr
switch (type) {
case ACL_TYPE_ACCESS:
mode = inode->i_mode;
- name = POSIX_ACL_XATTR_ACCESS;
- if (acl) {
- ret = posix_acl_equiv_mode(acl, &mode);
- if (ret < 0)
- return ret;
- inode->i_mode = mode;
- }
+ ret = posix_acl_equiv_mode(acl, &mode);
+ if (ret < 0)
+ return ret;
ret = 0;
+ inode->i_mode = mode;
+ name = POSIX_ACL_XATTR_ACCESS;
break;
case ACL_TYPE_DEFAULT:
if (!S_ISDIR(inode->i_mode))
@@ -143,7 +140,8 @@ static int btrfs_set_acl(struct btrfs_tr
goto out;
}
- ret = __btrfs_setxattr(trans, inode, name, value, size, 0);
+ ret = __btrfs_setxattr(inode, name, value, size, 0);
+
out:
kfree(value);
@@ -156,7 +154,7 @@ out:
static int btrfs_xattr_set_acl(struct inode *inode, int type,
const void *value, size_t size)
{
- int ret;
+ int ret = 0;
struct posix_acl *acl = NULL;
if (!is_owner_or_cap(inode))
@@ -172,7 +170,7 @@ static int btrfs_xattr_set_acl(struct in
}
}
- ret = btrfs_set_acl(NULL, inode, acl, type);
+ ret = btrfs_set_acl(inode, acl, type);
posix_acl_release(acl);
@@ -226,8 +224,7 @@ int btrfs_check_acl(struct inode *inode,
* stuff has been fixed to work with that. If the locking stuff changes, we
* need to re-evaluate the acl locking stuff.
*/
-int btrfs_init_acl(struct btrfs_trans_handle *trans,
- struct inode *inode, struct inode *dir)
+int btrfs_init_acl(struct inode *inode, struct inode *dir)
{
struct posix_acl *acl = NULL;
int ret = 0;
@@ -252,8 +249,7 @@ int btrfs_init_acl(struct btrfs_trans_ha
mode_t mode;
if (S_ISDIR(inode->i_mode)) {
- ret = btrfs_set_acl(trans, inode, acl,
- ACL_TYPE_DEFAULT);
+ ret = btrfs_set_acl(inode, acl, ACL_TYPE_DEFAULT);
if (ret)
goto failed;
}
@@ -268,11 +264,10 @@ int btrfs_init_acl(struct btrfs_trans_ha
inode->i_mode = mode;
if (ret > 0) {
/* we need an acl */
- ret = btrfs_set_acl(trans, inode, clone,
+ ret = btrfs_set_acl(inode, clone,
ACL_TYPE_ACCESS);
}
}
- posix_acl_release(clone);
}
failed:
posix_acl_release(acl);
@@ -302,7 +297,7 @@ int btrfs_acl_chmod(struct inode *inode)
ret = posix_acl_chmod_masq(clone, inode->i_mode);
if (!ret)
- ret = btrfs_set_acl(NULL, inode, clone, ACL_TYPE_ACCESS);
+ ret = btrfs_set_acl(inode, clone, ACL_TYPE_ACCESS);
posix_acl_release(clone);
@@ -328,8 +323,7 @@ int btrfs_acl_chmod(struct inode *inode)
return 0;
}
-int btrfs_init_acl(struct btrfs_trans_handle *trans,
- struct inode *inode, struct inode *dir)
+int btrfs_init_acl(struct inode *inode, struct inode *dir)
{
return 0;
}