aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-03-07 17:39:44 +0100
committerDavid Sterba <dsterba@suse.com>2023-04-17 18:01:17 +0200
commitb41bbd293e64016b3bfad4e5f709fcc07f00b2c5 (patch)
treead78e785167f044b855f3cf2b7fe4f8e9de5935d /fs/btrfs/inode.c
parent9dfde1b47b9d7e090d9bf34f8a7ef4d89735f9e6 (diff)
btrfs: return a btrfs_bio from btrfs_bio_alloc
Return the containing struct btrfs_bio instead of the less type safe struct bio from btrfs_bio_alloc. Reviewed-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b5a82d22dbd1..76d93b9e94a9 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9928,24 +9928,24 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
.pending = ATOMIC_INIT(1),
};
unsigned long i = 0;
- struct bio *bio;
+ struct btrfs_bio *bbio;
init_waitqueue_head(&priv.wait);
- bio = btrfs_bio_alloc(BIO_MAX_VECS, REQ_OP_READ, inode,
+ bbio = btrfs_bio_alloc(BIO_MAX_VECS, REQ_OP_READ, inode,
btrfs_encoded_read_endio, &priv);
- bio->bi_iter.bi_sector = disk_bytenr >> SECTOR_SHIFT;
+ bbio->bio.bi_iter.bi_sector = disk_bytenr >> SECTOR_SHIFT;
do {
size_t bytes = min_t(u64, disk_io_size, PAGE_SIZE);
- if (bio_add_page(bio, pages[i], bytes, 0) < bytes) {
+ if (bio_add_page(&bbio->bio, pages[i], bytes, 0) < bytes) {
atomic_inc(&priv.pending);
- btrfs_submit_bio(btrfs_bio(bio), 0);
+ btrfs_submit_bio(bbio, 0);
- bio = btrfs_bio_alloc(BIO_MAX_VECS, REQ_OP_READ, inode,
- btrfs_encoded_read_endio, &priv);
- bio->bi_iter.bi_sector = disk_bytenr >> SECTOR_SHIFT;
+ bbio = btrfs_bio_alloc(BIO_MAX_VECS, REQ_OP_READ, inode,
+ btrfs_encoded_read_endio, &priv);
+ bbio->bio.bi_iter.bi_sector = disk_bytenr >> SECTOR_SHIFT;
continue;
}
@@ -9955,7 +9955,7 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
} while (disk_io_size);
atomic_inc(&priv.pending);
- btrfs_submit_bio(btrfs_bio(bio), 0);
+ btrfs_submit_bio(bbio, 0);
if (atomic_dec_return(&priv.pending))
io_wait_event(priv.wait, !atomic_read(&priv.pending));