public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: Open code insert_orphan_item
@ 2020-10-22 15:40 Nikolay Borisov
  2020-10-23  3:11 ` Anand Jain
  2020-10-23 17:00 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Nikolay Borisov @ 2020-10-22 15:40 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

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(-)

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:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: Open code insert_orphan_item
  2020-10-22 15:40 [PATCH] btrfs: Open code insert_orphan_item Nikolay Borisov
@ 2020-10-23  3:11 ` Anand Jain
  2020-10-23 17:00 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Anand Jain @ 2020-10-23  3:11 UTC (permalink / raw)
  To: Nikolay Borisov, linux-btrfs

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: Open code insert_orphan_item
  2020-10-22 15:40 [PATCH] btrfs: Open code insert_orphan_item Nikolay Borisov
  2020-10-23  3:11 ` Anand Jain
@ 2020-10-23 17:00 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2020-10-23 17:00 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-btrfs

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-23 17:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-22 15:40 [PATCH] btrfs: Open code insert_orphan_item Nikolay Borisov
2020-10-23  3:11 ` Anand Jain
2020-10-23 17:00 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox