diff options
Diffstat (limited to 'fs/btrfs/xattr.c')
-rw-r--r-- | fs/btrfs/xattr.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 193b58f7d3f3..88ecbb215878 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -154,15 +154,10 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans, | |||
154 | if (trans) | 154 | if (trans) |
155 | return do_setxattr(trans, inode, name, value, size, flags); | 155 | return do_setxattr(trans, inode, name, value, size, flags); |
156 | 156 | ||
157 | ret = btrfs_reserve_metadata_space(root, 2); | 157 | trans = btrfs_start_transaction(root, 2); |
158 | if (ret) | 158 | if (IS_ERR(trans)) |
159 | return ret; | 159 | return PTR_ERR(trans); |
160 | 160 | ||
161 | trans = btrfs_start_transaction(root, 1); | ||
162 | if (!trans) { | ||
163 | ret = -ENOMEM; | ||
164 | goto out; | ||
165 | } | ||
166 | btrfs_set_trans_block_group(trans, inode); | 161 | btrfs_set_trans_block_group(trans, inode); |
167 | 162 | ||
168 | ret = do_setxattr(trans, inode, name, value, size, flags); | 163 | ret = do_setxattr(trans, inode, name, value, size, flags); |
@@ -174,7 +169,6 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans, | |||
174 | BUG_ON(ret); | 169 | BUG_ON(ret); |
175 | out: | 170 | out: |
176 | btrfs_end_transaction_throttle(trans, root); | 171 | btrfs_end_transaction_throttle(trans, root); |
177 | btrfs_unreserve_metadata_space(root, 2); | ||
178 | return ret; | 172 | return ret; |
179 | } | 173 | } |
180 | 174 | ||
@@ -282,7 +276,7 @@ err: | |||
282 | * List of handlers for synthetic system.* attributes. All real ondisk | 276 | * List of handlers for synthetic system.* attributes. All real ondisk |
283 | * attributes are handled directly. | 277 | * attributes are handled directly. |
284 | */ | 278 | */ |
285 | struct xattr_handler *btrfs_xattr_handlers[] = { | 279 | const struct xattr_handler *btrfs_xattr_handlers[] = { |
286 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL | 280 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL |
287 | &btrfs_xattr_acl_access_handler, | 281 | &btrfs_xattr_acl_access_handler, |
288 | &btrfs_xattr_acl_default_handler, | 282 | &btrfs_xattr_acl_default_handler, |