Re: [PATCH 2/5] block: add request->io_data_len

From: Tejun Heo
Date: Mon Apr 13 2020 - 09:52:22 EST


Hello,

On Wed, Apr 08, 2020 at 08:44:17PM -0700, Bart Van Assche wrote:
> On 2020-04-08 13:14, Tejun Heo wrote:
> > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> > index 32868fbedc9e..bfd34c6a27ef 100644
> > --- a/include/linux/blkdev.h
> > +++ b/include/linux/blkdev.h
> > @@ -142,6 +142,14 @@ struct request {
> >
> > /* the following two fields are internal, NEVER access directly */
> > unsigned int __data_len; /* total data len */
> > +#ifdef CONFIG_BLK_RQ_IO_DATA_LEN
> > + /*
> > + * Total data len at the time of issue. This doesn't get deducted by
> > + * blk_update_request() and can be used by completion path to determine
> > + * the request size.
> > + */
> > + unsigned int io_data_len;
> > +#endif
> > sector_t __sector; /* sector cursor */
> >
> > struct bio *bio;
>
> So we have one struct member with the description "total data len" and
> another struct member with the description "total data len at the time
> of issue"? How could one not get confused by these descriptions?

The new one explicitly says it doesn't get deducted by update_request.

> This change makes the comment above __data_len incorrect. Please update
> that comment or move io_data_len in front of that comment.

Sure.

> How does this change interact with the code in drivers/scsi/sd.c that
> manipulates __data_len directly?

It doesn't.

Thanks.

--
tejun