diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-04 06:45:19 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-05-16 17:03:12 +0200 |
commit | 91e3b5f1e293a2e617313a85bafd80d5eb4810f1 (patch) | |
tree | 53cb5c38f21a0928243f4a4b8b81e121f2ef96e5 | |
parent | 58ff51f148ec498758d66c226cb2f7a065b36478 (diff) | |
download | lwn-91e3b5f1e293a2e617313a85bafd80d5eb4810f1.tar.gz lwn-91e3b5f1e293a2e617313a85bafd80d5eb4810f1.zip |
btrfs: check-integrity: simplify bio allocation in btrfsic_read_block
btrfsic_read_block does not need the btrfs_bio structure, so switch to
plain bio_alloc (that also does not fail as it's backed by a bioset).
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/check-integrity.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index ab27b2c10456..5d20137b7b67 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -1561,10 +1561,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], |