diff mbox series

btrfs: Open code insert_orphan_item

Message ID 20201022154046.1654593-1-nborisov@suse.com
State New, archived
Headers show
Series btrfs: Open code insert_orphan_item | expand

Commit Message

Nikolay Borisov Oct. 22, 2020, 3:40 p.m. UTC
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(-)

Comments

Anand Jain Oct. 23, 2020, 3:11 a.m. UTC | #1
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>
David Sterba Oct. 23, 2020, 5 p.m. UTC | #2
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 mbox series

Patch

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: