diff options
Diffstat (limited to 'fs/btrfs/acl.c')
| -rw-r--r-- | fs/btrfs/acl.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 52cbe47022bf..2e9e69987a82 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
| @@ -94,7 +94,8 @@ static int btrfs_xattr_acl_get(struct dentry *dentry, const char *name, | |||
| 94 | /* | 94 | /* |
| 95 | * Needs to be called with fs_mutex held | 95 | * Needs to be called with fs_mutex held |
| 96 | */ | 96 | */ |
| 97 | static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | 97 | static int btrfs_set_acl(struct btrfs_trans_handle *trans, |
| 98 | struct inode *inode, struct posix_acl *acl, int type) | ||
| 98 | { | 99 | { |
| 99 | int ret, size = 0; | 100 | int ret, size = 0; |
| 100 | const char *name; | 101 | const char *name; |
| @@ -140,8 +141,7 @@ static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
| 140 | goto out; | 141 | goto out; |
| 141 | } | 142 | } |
| 142 | 143 | ||
| 143 | ret = __btrfs_setxattr(inode, name, value, size, 0); | 144 | ret = __btrfs_setxattr(trans, inode, name, value, size, 0); |
| 144 | |||
| 145 | out: | 145 | out: |
| 146 | kfree(value); | 146 | kfree(value); |
| 147 | 147 | ||
| @@ -154,7 +154,7 @@ out: | |||
| 154 | static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, | 154 | static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, |
| 155 | const void *value, size_t size, int flags, int type) | 155 | const void *value, size_t size, int flags, int type) |
| 156 | { | 156 | { |
| 157 | int ret = 0; | 157 | int ret; |
| 158 | struct posix_acl *acl = NULL; | 158 | struct posix_acl *acl = NULL; |
| 159 | 159 | ||
| 160 | if (value) { | 160 | if (value) { |
| @@ -167,7 +167,7 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, | |||
| 167 | } | 167 | } |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | ret = btrfs_set_acl(dentry->d_inode, acl, type); | 170 | ret = btrfs_set_acl(NULL, dentry->d_inode, acl, type); |
| 171 | 171 | ||
| 172 | posix_acl_release(acl); | 172 | posix_acl_release(acl); |
| 173 | 173 | ||
| @@ -196,7 +196,8 @@ int btrfs_check_acl(struct inode *inode, int mask) | |||
| 196 | * stuff has been fixed to work with that. If the locking stuff changes, we | 196 | * stuff has been fixed to work with that. If the locking stuff changes, we |
| 197 | * need to re-evaluate the acl locking stuff. | 197 | * need to re-evaluate the acl locking stuff. |
| 198 | */ | 198 | */ |
| 199 | int btrfs_init_acl(struct inode *inode, struct inode *dir) | 199 | int btrfs_init_acl(struct btrfs_trans_handle *trans, |
| 200 | struct inode *inode, struct inode *dir) | ||
| 200 | { | 201 | { |
| 201 | struct posix_acl *acl = NULL; | 202 | struct posix_acl *acl = NULL; |
| 202 | int ret = 0; | 203 | int ret = 0; |
| @@ -221,7 +222,8 @@ int btrfs_init_acl(struct inode *inode, struct inode *dir) | |||
| 221 | mode_t mode; | 222 | mode_t mode; |
| 222 | 223 | ||
| 223 | if (S_ISDIR(inode->i_mode)) { | 224 | if (S_ISDIR(inode->i_mode)) { |
| 224 | ret = btrfs_set_acl(inode, acl, ACL_TYPE_DEFAULT); | 225 | ret = btrfs_set_acl(trans, inode, acl, |
| 226 | ACL_TYPE_DEFAULT); | ||
| 225 | if (ret) | 227 | if (ret) |
| 226 | goto failed; | 228 | goto failed; |
| 227 | } | 229 | } |
| @@ -236,7 +238,7 @@ int btrfs_init_acl(struct inode *inode, struct inode *dir) | |||
| 236 | inode->i_mode = mode; | 238 | inode->i_mode = mode; |
| 237 | if (ret > 0) { | 239 | if (ret > 0) { |
| 238 | /* we need an acl */ | 240 | /* we need an acl */ |
| 239 | ret = btrfs_set_acl(inode, clone, | 241 | ret = btrfs_set_acl(trans, inode, clone, |
| 240 | ACL_TYPE_ACCESS); | 242 | ACL_TYPE_ACCESS); |
| 241 | } | 243 | } |
| 242 | } | 244 | } |
| @@ -269,7 +271,7 @@ int btrfs_acl_chmod(struct inode *inode) | |||
| 269 | 271 | ||
| 270 | ret = posix_acl_chmod_masq(clone, inode->i_mode); | 272 | ret = posix_acl_chmod_masq(clone, inode->i_mode); |
| 271 | if (!ret) | 273 | if (!ret) |
| 272 | ret = btrfs_set_acl(inode, clone, ACL_TYPE_ACCESS); | 274 | ret = btrfs_set_acl(NULL, inode, clone, ACL_TYPE_ACCESS); |
| 273 | 275 | ||
| 274 | posix_acl_release(clone); | 276 | posix_acl_release(clone); |
| 275 | 277 | ||
| @@ -297,7 +299,8 @@ int btrfs_acl_chmod(struct inode *inode) | |||
| 297 | return 0; | 299 | return 0; |
| 298 | } | 300 | } |
| 299 | 301 | ||
| 300 | int btrfs_init_acl(struct inode *inode, struct inode *dir) | 302 | int btrfs_init_acl(struct btrfs_trans_handle *trans, |
| 303 | struct inode *inode, struct inode *dir) | ||
| 301 | { | 304 | { |
| 302 | return 0; | 305 | return 0; |
| 303 | } | 306 | } |
