[PATCH 1/2] blk-integrity: add scatter-less DMA mapping helpers

Keith Busch kbusch at kernel.org
Wed Jun 25 14:17:32 PDT 2025


On Wed, Jun 25, 2025 at 01:44:44PM -0700, Keith Busch wrote:
> +	while (!iter->iter.bi_size || !iter->iter.bi_bvec_done) {
> +		struct bio_vec next;
> +
> +		if (!iter->iter.bi_size) {
> +			if (!iter->bio->bi_next)
> +				break;
> +			iter->bio = iter->bio->bi_next;
> +			iter->iter = iter->bio->bi_iter;

Ugh, this should have been:

			bip = bio_integrity(iter->bio);
			iter->iter = bip->bip_iter;


> +		}
> +
> +		next = mp_bvec_iter_bvec(iter->bio->bi_io_vec, iter->iter);

And then this should be:

		next = mp_bvec_iter_bvec(bip->bip_vec, iter->iter);

Obviously I didn't test merging bio's into plugged requests...

> +bool blk_rq_integrity_dma_map_iter_start(struct request *req,
> +		struct device *dma_dev, struct blk_dma_iter *iter)
> +{
...
> +}
> +EXPORT_SYMBOL_GPL(blk_rq_integrity_map_iter_start);

And while I'm pointing out my mistakes, this last second name change was
pretty stupid... The export symbol needs the "_dma_" part.



More information about the Linux-nvme mailing list