]> www.infradead.org Git - users/hch/block.git/commitdiff
btrfs: simplify btrfsic_read_block
authorChristoph Hellwig <hch@lst.de>
Fri, 14 Jan 2022 10:08:34 +0000 (11:08 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 9 Feb 2022 08:33:03 +0000 (09:33 +0100)
btrfsic_read_block does not need the btrfs_bio structure, so switch to
plain bio_alloc.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/btrfs/check-integrity.c

index abac86a758401edd3dfaa95b42c6b5af6711e73d..8d27d3b45b65129f967ceae1d47da43248ce0f87 100644 (file)
@@ -1563,10 +1563,9 @@ static int btrfsic_read_block(struct btrfsic_state *state,
                struct bio *bio;
                unsigned int j;
 
-               bio = btrfs_bio_alloc(num_pages - i);
-               bio_set_dev(bio, block_ctx->dev->bdev);
+               bio = bio_alloc(block_ctx->dev->bdev, num_pages - i,
+                               REQ_OP_READ, GFP_NOFS);
                bio->bi_iter.bi_sector = dev_bytenr >> 9;
-               bio->bi_opf = REQ_OP_READ;
 
                for (j = i; j < num_pages; j++) {
                        ret = bio_add_page(bio, block_ctx->pagev[j],