diff options
| author | Filipe Manana <fdmanana@suse.com> | 2025-03-05 12:22:39 +0000 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-03-18 20:35:49 +0100 |
| commit | 530b601b912c42900a37d849b8a3592c8a560432 (patch) | |
| tree | af6c46d4dd26abe0e513dc8c8496834a95f90a2d | |
| parent | btrfs: fix non-empty delayed iputs list on unmount due to compressed write wo... (diff) | |
| download | linux-530b601b912c42900a37d849b8a3592c8a560432.tar.gz linux-530b601b912c42900a37d849b8a3592c8a560432.zip | |
btrfs: move __btrfs_bio_end_io() code into its single caller
The __btrfs_bio_end_io() helper is trivial and has a single caller, so
there's no point in having a dedicated helper function. Further the double
underscore prefix in the name is discouraged. 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.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index bc2555c44a12..94b9ab60bade 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -105,18 +105,6 @@ static void btrfs_cleanup_bio(struct btrfs_bio *bbio) bio_put(&bbio->bio); } -static void __btrfs_bio_end_io(struct btrfs_bio *bbio) -{ - if (bbio_has_ordered_extent(bbio)) { - struct btrfs_ordered_extent *ordered = bbio->ordered; - - bbio->end_io(bbio); - btrfs_put_ordered_extent(ordered); - } else { - bbio->end_io(bbio); - } -} - void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status) { bbio->bio.bi_status = status; @@ -138,7 +126,15 @@ void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status) /* Load split bio's error which might be set above. */ if (status == BLK_STS_OK) bbio->bio.bi_status = READ_ONCE(bbio->status); - __btrfs_bio_end_io(bbio); + + if (bbio_has_ordered_extent(bbio)) { + struct btrfs_ordered_extent *ordered = bbio->ordered; + + bbio->end_io(bbio); + btrfs_put_ordered_extent(ordered); + } else { + bbio->end_io(bbio); + } } } |
