diff options
author | Filipe Manana <fdmanana@suse.com> | 2025-03-06 20:47:34 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-03-18 22:35:50 +0300 |
commit | 08f340767dde5fd302af5b94ce6ce2d5e38a233d (patch) | |
tree | 24920de94d4e656038380528b613f7a988d62ead | |
parent | 0c8337c22043511549162df877cf752566aeedb9 (diff) | |
download | linux-08f340767dde5fd302af5b94ce6ce2d5e38a233d.tar.xz |
btrfs: send: simplify return logic from send_encoded_extent()
The 'out' label is pointless as we don't have anything to cleanup anymore
(we used to have an inode to iput), so remove it and make error paths
directly return an error.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/send.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 329ccd6f2759..17a6ed3691e7 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -5531,14 +5531,12 @@ static int send_encoded_inline_extent(struct send_ctx *sctx, int ret; fspath = get_cur_inode_path(sctx); - if (IS_ERR(fspath)) { - ret = PTR_ERR(fspath); - goto out; - } + if (IS_ERR(fspath)) + return PTR_ERR(fspath); ret = begin_cmd(sctx, BTRFS_SEND_C_ENCODED_WRITE); if (ret < 0) - goto out; + return ret; btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item); @@ -5554,12 +5552,12 @@ static int send_encoded_inline_extent(struct send_ctx *sctx, ret = btrfs_encoded_io_compression_from_extent(fs_info, btrfs_file_extent_compression(leaf, ei)); if (ret < 0) - goto out; + return ret; TLV_PUT_U32(sctx, BTRFS_SEND_A_COMPRESSION, ret); ret = put_data_header(sctx, inline_size); if (ret < 0) - goto out; + return ret; read_extent_buffer(leaf, sctx->send_buf + sctx->send_size, btrfs_file_extent_inline_start(ei), inline_size); sctx->send_size += inline_size; @@ -5567,7 +5565,6 @@ static int send_encoded_inline_extent(struct send_ctx *sctx, ret = send_cmd(sctx); tlv_put_failure: -out: return ret; } |