Commit da9b6ec8 authored by Anand Jain's avatar Anand Jain Committed by David Sterba

btrfs: merge calls of btrfs_setxattr and btrfs_setxattr_trans in btrfs_set_prop

Since now the trans argument is never NULL in btrfs_set_prop we don't
have to check. So delete it and use btrfs_setxattr that makes use of
that.
Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 717ebdc3
...@@ -84,12 +84,8 @@ int btrfs_set_prop(struct btrfs_trans_handle *trans, struct inode *inode, ...@@ -84,12 +84,8 @@ int btrfs_set_prop(struct btrfs_trans_handle *trans, struct inode *inode,
return -EINVAL; return -EINVAL;
if (value_len == 0) { if (value_len == 0) {
if (trans)
ret = btrfs_setxattr(trans, inode, handler->xattr_name, ret = btrfs_setxattr(trans, inode, handler->xattr_name,
NULL, 0, flags); NULL, 0, flags);
else
ret = btrfs_setxattr_trans(inode, handler->xattr_name,
NULL, 0, flags);
if (ret) if (ret)
return ret; return ret;
...@@ -99,23 +95,14 @@ int btrfs_set_prop(struct btrfs_trans_handle *trans, struct inode *inode, ...@@ -99,23 +95,14 @@ int btrfs_set_prop(struct btrfs_trans_handle *trans, struct inode *inode,
return ret; return ret;
} }
if (trans)
ret = btrfs_setxattr(trans, inode, handler->xattr_name, value, ret = btrfs_setxattr(trans, inode, handler->xattr_name, value,
value_len, flags); value_len, flags);
else
ret = btrfs_setxattr_trans(inode, handler->xattr_name, value,
value_len, flags);
if (ret) if (ret)
return ret; return ret;
ret = handler->apply(inode, value, value_len); ret = handler->apply(inode, value, value_len);
if (ret) { if (ret) {
if (trans)
btrfs_setxattr(trans, inode, handler->xattr_name, NULL, btrfs_setxattr(trans, inode, handler->xattr_name, NULL,
0, flags); 0, flags);
else
btrfs_setxattr_trans(inode, handler->xattr_name, NULL,
0, flags);
return ret; return ret;
} }
......
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