Message ID | 20201022154046.1654593-1-nborisov@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: Open code insert_orphan_item | expand |
On 22/10/20 11:40 pm, Nikolay Borisov wrote: > Just open code it in its sole caller and remove a level of indirection. > > Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com>
On Thu, Oct 22, 2020 at 06:40:46PM +0300, Nikolay Borisov wrote: > Just open code it in its sole caller and remove a level of indirection. > > Signed-off-by: Nikolay Borisov <nborisov@suse.com> Added to misc-next, thanks.
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 3ec3e06783a0..71bd0f08543b 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -1565,18 +1565,6 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, return ret; } -static int insert_orphan_item(struct btrfs_trans_handle *trans, - struct btrfs_root *root, u64 ino) -{ - int ret; - - ret = btrfs_insert_orphan_item(trans, root, ino); - if (ret == -EEXIST) - ret = 0; - - return ret; -} - static int count_inode_extrefs(struct btrfs_root *root, struct btrfs_inode *inode, struct btrfs_path *path) { @@ -1728,7 +1716,9 @@ static noinline int fixup_inode_link_count(struct btrfs_trans_handle *trans, if (ret) goto out; } - ret = insert_orphan_item(trans, root, ino); + ret = btrfs_insert_orphan_item(trans, root, ino); + if (ret == -EEXIST) + ret = 0; } out:
Just open code it in its sole caller and remove a level of indirection. Signed-off-by: Nikolay Borisov <nborisov@suse.com> --- fs/btrfs/tree-log.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)