Re: [PATCHv5 2/8] blk-mq-dma: provide the bio_vec list being iterated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 08, 2025 at 08:58:20AM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@xxxxxxxxxx>
> 
> This will make it easier to add different sources of the bvec table,
> like for upcoming integrity support, rather than assume to use the bio's
> bi_io_vec. It also makes iterating "special" payloads more in common
> with iterating normal payloads.

I would call the array a table (or maybe array) and not a list.

> +static struct blk_map_iter blk_rq_map_iter(struct request *rq)
> +{
> +	struct bio *bio = rq->bio;
> +
> +	if (rq->rq_flags & RQF_SPECIAL_PAYLOAD) {
> +		return (struct blk_map_iter) {
> +			.bvec = &rq->special_vec,
> +			.iter = {
> +				.bi_size = rq->special_vec.bv_len,
> +			}
> +		};

These large struct returns generate really horrible code if they aren't
inlined (although that might happen here).  I also find them not very
nice to read.  Any reason to just pass a pointer and initialize the
needed fields?

Also this function probably should be named blk_rq_map_iter_start or
blk_rq_map_iter_init as it only is used for the very first iteration.





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux