diff options
| author | Sun YangKai <sunk67188@gmail.com> | 2025-09-22 19:30:07 +0800 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-09-23 08:49:26 +0200 |
| commit | 4ca6f24a52c4e94bd09f70cf132d0a38db7996b0 (patch) | |
| tree | d85e13f342aab346508229d8f8004d4022612827 /fs/btrfs/reflink.c | |
| parent | c9ff83963a49a413b8ace36de21f61b47f461b98 (diff) | |
btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions
Trivial pattern for the auto freeing with goto -> return conversions
if possible.
The following cases are considered trivial in this patch:
1. Cases where there are no operations between btrfs_free_path() and the
function returns.
2. Cases where only simple cleanup operations (such as kfree(), kvfree(),
clear_bit(), and fs_path_free()) are present between
btrfs_free_path() and the function return.
Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/reflink.c')
| -rw-r--r-- | fs/btrfs/reflink.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c index 0a85e1da9777..f78ac494197f 100644 --- a/fs/btrfs/reflink.c +++ b/fs/btrfs/reflink.c @@ -340,7 +340,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode, const u64 destoff, bool no_time_update) { struct btrfs_fs_info *fs_info = inode_to_fs_info(inode); - struct btrfs_path *path = NULL; + BTRFS_PATH_AUTO_FREE(path); struct extent_buffer *leaf; struct btrfs_trans_handle *trans; char *buf = NULL; @@ -611,7 +611,6 @@ process_slot: } out: - btrfs_free_path(path); kvfree(buf); clear_bit(BTRFS_INODE_NO_DELALLOC_FLUSH, &BTRFS_I(inode)->runtime_flags); |