diff mbox series

[03/27] btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_setup_space_cache()

Message ID a84e42979c660f457634932e94b8867f8bfe8adc.1740562070.git.dsterba@suse.com (mailing list archive)
State New
Headers show
Series Struct btrfs_path auto cleaning conversions | expand

Commit Message

David Sterba Feb. 26, 2025, 9:50 a.m. UTC
This is the trivial pattern for path auto free, initialize at the
beginning and free at the end.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/block-group.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 9c689e7982c2..d99e5ed307d5 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -3303,7 +3303,7 @@  int btrfs_setup_space_cache(struct btrfs_trans_handle *trans)
 	struct btrfs_fs_info *fs_info = trans->fs_info;
 	struct btrfs_block_group *cache, *tmp;
 	struct btrfs_transaction *cur_trans = trans->transaction;
-	struct btrfs_path *path;
+	BTRFS_PATH_AUTO_FREE(path);
 
 	if (list_empty(&cur_trans->dirty_bgs) ||
 	    !btrfs_test_opt(fs_info, SPACE_CACHE))
@@ -3320,7 +3320,6 @@  int btrfs_setup_space_cache(struct btrfs_trans_handle *trans)
 			cache_save_setup(cache, trans, path);
 	}
 
-	btrfs_free_path(path);
 	return 0;
 }