summaryrefslogtreecommitdiff
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-01-24 12:11:05 +0300
committerJens Axboe <axboe@kernel.dk>2022-02-02 17:49:59 +0300
commit07888c665b405b1cd3577ddebfeb74f4717a84c4 (patch)
treefe3700fcd1b741ddd3caa84a184a8aaaf9e098d7 /fs/nilfs2
parentb77c88c2100ce6a5ec8126c13599b5a7f6663e32 (diff)
downloadlinux-07888c665b405b1cd3577ddebfeb74f4717a84c4.tar.xz
block: pass a block_device and opf to bio_alloc
Pass the block_device and operation that we plan to use this bio for to bio_alloc to optimize the assignment. NULL/0 can be passed, both for the passthrough case on a raw request_queue and to temporarily avoid refactoring some nasty code. Also move the gfp_mask argument after the nr_vecs argument for a much more logical calling convention matching what most of the kernel does. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://lore.kernel.org/r/20220124091107.642561-18-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/segbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 53b7c6d21cdd..4f71faacd825 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -391,8 +391,8 @@ static int nilfs_segbuf_submit_bh(struct nilfs_segment_buffer *segbuf,
BUG_ON(wi->nr_vecs <= 0);
repeat:
if (!wi->bio) {
- wi->bio = bio_alloc(GFP_NOIO, wi->nr_vecs);
- bio_set_dev(wi->bio, wi->nilfs->ns_bdev);
+ wi->bio = bio_alloc(wi->nilfs->ns_bdev, wi->nr_vecs, 0,
+ GFP_NOIO);
wi->bio->bi_iter.bi_sector = (wi->blocknr + wi->end) <<
(wi->nilfs->ns_blocksize_bits - 9);
}