summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-03-05 13:16:08 +0000
committerDavid Sterba <dsterba@suse.com>2025-03-18 20:35:49 +0100
commit477a7a9c1f46b179ccc5eb2bbf18a0966055a464 (patch)
tree66dc499a6fc57f67de88c2eabcb1d2d23a19da04
parent530b601b912c42900a37d849b8a3592c8a560432 (diff)
downloadlinux-477a7a9c1f46b179ccc5eb2bbf18a0966055a464.tar.gz
linux-477a7a9c1f46b179ccc5eb2bbf18a0966055a464.tar.bz2
linux-477a7a9c1f46b179ccc5eb2bbf18a0966055a464.zip
btrfs: move btrfs_cleanup_bio() code into its single caller
The btrfs_cleanup_bio() helper is trivial and has a single caller, there's no point in having a dedicated helper function. So get rid of it and move its code into the caller (btrfs_bio_end_io()). 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/bio.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
index 94b9ab60bade..375cae2fbcad 100644
--- a/fs/btrfs/bio.c
+++ b/fs/btrfs/bio.c
@@ -97,21 +97,17 @@ static struct btrfs_bio *btrfs_split_bio(struct btrfs_fs_info *fs_info,
return bbio;
}
-/* Free a bio that was never submitted to the underlying device. */
-static void btrfs_cleanup_bio(struct btrfs_bio *bbio)
-{
- if (bbio_has_ordered_extent(bbio))
- btrfs_put_ordered_extent(bbio->ordered);
- bio_put(&bbio->bio);
-}
-
void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status)
{
bbio->bio.bi_status = status;
if (bbio->bio.bi_pool == &btrfs_clone_bioset) {
struct btrfs_bio *orig_bbio = bbio->private;
- btrfs_cleanup_bio(bbio);
+ /* Free bio that was never submitted to the underlying device. */
+ if (bbio_has_ordered_extent(bbio))
+ btrfs_put_ordered_extent(bbio->ordered);
+ bio_put(&bbio->bio);
+
bbio = orig_bbio;
}