diff options
| author | Christoph Hellwig <hch@lst.de> | 2025-09-08 12:56:38 +0200 | 
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-09-09 07:31:59 -0600 | 
| commit | 70a6f71b1a77decfc5b1db426ccbe914b58adb38 (patch) | |
| tree | af20c750ab2fc8bcbf73989bc24476d2925df0ab /drivers | |
| parent | 9f7c02e031570e8291a63162c6c046dc15ff85b0 (diff) | |
block: add a bio_init_inline helper
Just a simpler wrapper around bio_init for callers that want to
initialize a bio with inline bvecs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/md/bcache/debug.c | 3 | ||||
| -rw-r--r-- | drivers/md/bcache/io.c | 3 | ||||
| -rw-r--r-- | drivers/md/bcache/journal.c | 2 | ||||
| -rw-r--r-- | drivers/md/bcache/movinggc.c | 2 | ||||
| -rw-r--r-- | drivers/md/bcache/super.c | 2 | ||||
| -rw-r--r-- | drivers/md/bcache/writeback.c | 2 | ||||
| -rw-r--r-- | drivers/md/dm-bufio.c | 2 | ||||
| -rw-r--r-- | drivers/md/dm-flakey.c | 2 | ||||
| -rw-r--r-- | drivers/md/raid1.c | 2 | ||||
| -rw-r--r-- | drivers/md/raid10.c | 4 | ||||
| -rw-r--r-- | drivers/target/target_core_pscsi.c | 2 | 
11 files changed, 12 insertions, 14 deletions
| diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 7510d1c983a5..f327456fc4e0 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -115,8 +115,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio)  	check = bio_kmalloc(nr_segs, GFP_NOIO);  	if (!check)  		return; -	bio_init(check, bio->bi_bdev, check->bi_inline_vecs, nr_segs, -		 REQ_OP_READ); +	bio_init_inline(check, bio->bi_bdev, nr_segs, REQ_OP_READ);  	check->bi_iter.bi_sector = bio->bi_iter.bi_sector;  	check->bi_iter.bi_size = bio->bi_iter.bi_size; diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index 020712c5203f..2386d08bf4e4 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c @@ -26,8 +26,7 @@ struct bio *bch_bbio_alloc(struct cache_set *c)  	struct bbio *b = mempool_alloc(&c->bio_meta, GFP_NOIO);  	struct bio *bio = &b->bio; -	bio_init(bio, NULL, bio->bi_inline_vecs, -		 meta_bucket_pages(&c->cache->sb), 0); +	bio_init_inline(bio, NULL, meta_bucket_pages(&c->cache->sb), 0);  	return bio;  } diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 7ff14bd2feb8..d50eb82ccb4f 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -615,7 +615,7 @@ static void do_journal_discard(struct cache *ca)  		atomic_set(&ja->discard_in_flight, DISCARD_IN_FLIGHT); -		bio_init(bio, ca->bdev, bio->bi_inline_vecs, 1, REQ_OP_DISCARD); +		bio_init_inline(bio, ca->bdev, 1, REQ_OP_DISCARD);  		bio->bi_iter.bi_sector	= bucket_to_sector(ca->set,  						ca->sb.d[ja->discard_idx]);  		bio->bi_iter.bi_size	= bucket_bytes(ca); diff --git a/drivers/md/bcache/movinggc.c b/drivers/md/bcache/movinggc.c index 26a6a535ec32..4fc80c6d5b31 100644 --- a/drivers/md/bcache/movinggc.c +++ b/drivers/md/bcache/movinggc.c @@ -79,7 +79,7 @@ static void moving_init(struct moving_io *io)  {  	struct bio *bio = &io->bio.bio; -	bio_init(bio, NULL, bio->bi_inline_vecs, +	bio_init_inline(bio, NULL,  		 DIV_ROUND_UP(KEY_SIZE(&io->w->key), PAGE_SECTORS), 0);  	bio_get(bio);  	bio->bi_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0); diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 1492c8552255..6d250e366412 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2236,7 +2236,7 @@ static int cache_alloc(struct cache *ca)  	__module_get(THIS_MODULE);  	kobject_init(&ca->kobj, &bch_cache_ktype); -	bio_init(&ca->journal.bio, NULL, ca->journal.bio.bi_inline_vecs, 8, 0); +	bio_init_inline(&ca->journal.bio, NULL, 8, 0);  	/*  	 * When the cache disk is first registered, ca->sb.njournal_buckets diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index 302e75f1fc4b..36dd8f14a6df 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c @@ -331,7 +331,7 @@ static void dirty_init(struct keybuf_key *w)  	struct dirty_io *io = w->private;  	struct bio *bio = &io->bio; -	bio_init(bio, NULL, bio->bi_inline_vecs, +	bio_init_inline(bio, NULL,  		 DIV_ROUND_UP(KEY_SIZE(&w->key), PAGE_SECTORS), 0);  	if (!io->dc->writeback_percent)  		bio->bi_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0); diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index ff7595caf440..8f3a23f4b168 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -1342,7 +1342,7 @@ static void use_bio(struct dm_buffer *b, enum req_op op, sector_t sector,  		use_dmio(b, op, sector, n_sectors, offset, ioprio);  		return;  	} -	bio_init(bio, b->c->bdev, bio->bi_inline_vecs, 1, op); +	bio_init_inline(bio, b->c->bdev, 1, op);  	bio->bi_iter.bi_sector = sector;  	bio->bi_end_io = bio_complete;  	bio->bi_private = b; diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c index cf17fd46e255..08925aca838c 100644 --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -441,7 +441,7 @@ static struct bio *clone_bio(struct dm_target *ti, struct flakey_c *fc, struct b  	if (!clone)  		return NULL; -	bio_init(clone, fc->dev->bdev, clone->bi_inline_vecs, nr_iovecs, bio->bi_opf); +	bio_init_inline(clone, fc->dev->bdev, nr_iovecs, bio->bi_opf);  	clone->bi_iter.bi_sector = flakey_map_sector(ti, bio->bi_iter.bi_sector);  	clone->bi_private = bio; diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 408c26398321..bc11aaa38615 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -167,7 +167,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)  		bio = bio_kmalloc(RESYNC_PAGES, gfp_flags);  		if (!bio)  			goto out_free_bio; -		bio_init(bio, NULL, bio->bi_inline_vecs, RESYNC_PAGES, 0); +		bio_init_inline(bio, NULL, RESYNC_PAGES, 0);  		r1_bio->bios[j] = bio;  	}  	/* diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index b60c30bfb6c7..c52ccd12d86b 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -163,14 +163,14 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)  		bio = bio_kmalloc(RESYNC_PAGES, gfp_flags);  		if (!bio)  			goto out_free_bio; -		bio_init(bio, NULL, bio->bi_inline_vecs, RESYNC_PAGES, 0); +		bio_init_inline(bio, NULL, RESYNC_PAGES, 0);  		r10_bio->devs[j].bio = bio;  		if (!conf->have_replacement)  			continue;  		bio = bio_kmalloc(RESYNC_PAGES, gfp_flags);  		if (!bio)  			goto out_free_bio; -		bio_init(bio, NULL, bio->bi_inline_vecs, RESYNC_PAGES, 0); +		bio_init_inline(bio, NULL, RESYNC_PAGES, 0);  		r10_bio->devs[j].repl_bio = bio;  	}  	/* diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index f991cf759836..db4e09042469 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -861,7 +861,7 @@ new_bio:  				bio = bio_kmalloc(nr_vecs, GFP_KERNEL);  				if (!bio)  					goto fail; -				bio_init(bio, NULL, bio->bi_inline_vecs, nr_vecs, +				bio_init_inline(bio, NULL, nr_vecs,  					 rw ? REQ_OP_WRITE : REQ_OP_READ);  				bio->bi_end_io = pscsi_bi_endio; | 
