[dm-devel] Any bio_clone_slow() implementation which doesn't share bi_io_vec?

hch at infradead.org hch at infradead.org
Wed Nov 24 06:09:35 UTC 2021


On Wed, Nov 24, 2021 at 07:07:18AM +0800, Qu Wenruo wrote:
> In that case, the missing piece seems to be a way to convert a splitted
> plain bio into a REQ_OP_ZONE_APPEND bio.
> 
> Can this be done without slow bvec copying?

Yes.  I have a WIP stacking driver that converts writes to zone appends
and it does just that:

	sector_t orig_sector = bio->bi_iter.bi_sector;
	unsigned int bio_flags = bio->bi_opf & ~REQ_OP_MASK;

	...

	clone = bio_clone_fast(bio, GFP_NOIO, &bdev->write_bio_set);

	...

	clone->bi_opf = REQ_OP_ZONE_APPEND | REQ_NOMERGE | bio_flags;
	bio_set_dev(clone, dev->lower_bdev);
	clone->bi_iter.bi_sector = zone_sector;
	trace_block_bio_remap(clone, disk_devt(disk), orig_sector);

> 
> Thanks,
> Qu
---end quoted text---




More information about the dm-devel mailing list