All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 02/10] btrfs: open code btrfs_backref_iter_free()
Date: Mon, 19 Feb 2024 12:12:49 +0100	[thread overview]
Message-ID: <5dd7da97f6874bdd4d99ae277821d16aaa3a0fa5.1708339010.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1708339010.git.dsterba@suse.com>

The helper is trivial and used only once, open code it. It's safe to
remove the 'if', the pointer is validated in build_backref_tree().

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/backref.h    | 8 --------
 fs/btrfs/relocation.c | 3 ++-
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h
index 523e594ac753..493ea47db426 100644
--- a/fs/btrfs/backref.h
+++ b/fs/btrfs/backref.h
@@ -283,14 +283,6 @@ struct btrfs_backref_iter {
 
 struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_info);
 
-static inline void btrfs_backref_iter_free(struct btrfs_backref_iter *iter)
-{
-	if (!iter)
-		return;
-	btrfs_free_path(iter->path);
-	kfree(iter);
-}
-
 static inline struct extent_buffer *btrfs_backref_get_eb(
 		struct btrfs_backref_iter *iter)
 {
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 2fca67f2b39b..f96f267fb4aa 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -523,7 +523,8 @@ static noinline_for_stack struct btrfs_backref_node *build_backref_tree(
 	if (handle_useless_nodes(rc, node))
 		node = NULL;
 out:
-	btrfs_backref_iter_free(iter);
+	btrfs_free_path(iter->path);
+	kfree(iter);
 	btrfs_free_path(path);
 	if (err) {
 		btrfs_backref_error_cleanup(cache, node);
-- 
2.42.1


  parent reply	other threads:[~2024-02-19 11:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 11:12 [PATCH 00/10] Static inline cleanups David Sterba
2024-02-19 11:12 ` [PATCH 01/10] btrfs: move balance args conversion helpers to volumes.c David Sterba
2024-02-19 11:12 ` David Sterba [this message]
2024-02-19 11:12 ` [PATCH 03/10] btrfs: open code btrfs_backref_get_eb() David Sterba
2024-02-19 11:12 ` [PATCH 04/10] btrfs: uninline some static inline helpers from backref.h David Sterba
2024-02-19 11:12 ` [PATCH 05/10] btrfs: uninline btrfs_init_delayed_root() David Sterba
2024-02-19 11:12 ` [PATCH 06/10] btrfs: drop static inline specifiers from tree-mod-log.c David Sterba
2024-02-19 11:13 ` [PATCH 07/10] btrfs: uninline some static inline helpers from tree-log.h David Sterba
2024-02-19 11:13 ` [PATCH 08/10] btrfs: simplify conditions in btrfs_free_chunk_map() David Sterba
2024-02-19 12:27   ` Filipe Manana
2024-02-19 14:41     ` David Sterba
2024-02-26  8:31   ` kernel test robot
2024-02-19 11:13 ` [PATCH 09/10] btrfs: open code trivial btrfs_lru_cache_size() David Sterba
2024-02-19 11:13 ` [PATCH 10/10] btrfs: uninline some static inline helpers from delayed-ref.h David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5dd7da97f6874bdd4d99ae277821d16aaa3a0fa5.1708339010.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.