diff options
author | Anand Jain <anand.jain@oracle.com> | 2019-04-20 19:49:00 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-04-29 19:02:54 +0200 |
commit | da9b6ec829dff9b867bb863ebb5b45b4ef2530a1 (patch) | |
tree | 64509d905a8e0c6f0c3c0b1cb56dd65664ec2708 /fs | |
parent | 717ebdc3205ab118dd041199072ec686a3fac7ee (diff) |
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: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/props.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c index c41ed2a6347e..ca2716917e37 100644 --- a/fs/btrfs/props.c +++ b/fs/btrfs/props.c @@ -84,12 +84,8 @@ int btrfs_set_prop(struct btrfs_trans_handle *trans, struct inode *inode, return -EINVAL; if (value_len == 0) { - if (trans) - ret = btrfs_setxattr(trans, inode, handler->xattr_name, - NULL, 0, flags); - else - ret = btrfs_setxattr_trans(inode, handler->xattr_name, - NULL, 0, flags); + ret = btrfs_setxattr(trans, inode, handler->xattr_name, + NULL, 0, flags); if (ret) return ret; @@ -99,23 +95,14 @@ int btrfs_set_prop(struct btrfs_trans_handle *trans, struct inode *inode, return ret; } - if (trans) - ret = btrfs_setxattr(trans, inode, handler->xattr_name, value, - value_len, flags); - else - ret = btrfs_setxattr_trans(inode, handler->xattr_name, value, - value_len, flags); - + ret = btrfs_setxattr(trans, inode, handler->xattr_name, value, + value_len, flags); if (ret) return ret; ret = handler->apply(inode, value, value_len); if (ret) { - if (trans) - btrfs_setxattr(trans, inode, handler->xattr_name, NULL, - 0, flags); - else - btrfs_setxattr_trans(inode, handler->xattr_name, NULL, - 0, flags); + btrfs_setxattr(trans, inode, handler->xattr_name, NULL, + 0, flags); return ret; } |