Skip to content

Commit 56430c1

Browse files
committed
btrfs: open code btrfs_backref_iter_free()
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>
1 parent e605234 commit 56430c1

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

fs/btrfs/backref.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,6 @@ struct btrfs_backref_iter {
283283

284284
struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_info);
285285

286-
static inline void btrfs_backref_iter_free(struct btrfs_backref_iter *iter)
287-
{
288-
if (!iter)
289-
return;
290-
btrfs_free_path(iter->path);
291-
kfree(iter);
292-
}
293-
294286
static inline struct extent_buffer *btrfs_backref_get_eb(
295287
struct btrfs_backref_iter *iter)
296288
{

fs/btrfs/relocation.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ static noinline_for_stack struct btrfs_backref_node *build_backref_tree(
523523
if (handle_useless_nodes(rc, node))
524524
node = NULL;
525525
out:
526-
btrfs_backref_iter_free(iter);
526+
btrfs_free_path(iter->path);
527+
kfree(iter);
527528
btrfs_free_path(path);
528529
if (err) {
529530
btrfs_backref_error_cleanup(cache, node);

0 commit comments

Comments
 (0)