btrfs: avoid unnecessary bio dereference at run_one_async_done()
authorFilipe Manana <fdmanana@suse.com>
Thu, 6 Mar 2025 16:07:18 +0000 (16:07 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:50 +0000 (20:35 +0100)
We have dereferenced the async_submit_bio structure and extracted the bio
pointer into a local variable, so there's no need to dereference it again
when calling btrfs_bio_end_io(). Just use "bio->bi_status" instead of the
longer expression "async->bbio->bio.bi_status".

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>
fs/btrfs/bio.c

index 375cae2fbcad4554efe7037c5b518c8cf54adaaa..8c2eee1f18787e8a34ddcc5db47c9941ec3ad5ed 100644 (file)
@@ -573,7 +573,7 @@ static void run_one_async_done(struct btrfs_work *work, bool do_free)
 
        /* If an error occurred we just want to clean up the bio and move on. */
        if (bio->bi_status) {
-               btrfs_bio_end_io(async->bbio, async->bbio->bio.bi_status);
+               btrfs_bio_end_io(async->bbio, bio->bi_status);
                return;
        }