On 6/6/19 12:29 PM, Christoph Hellwig wrote:
> We only need the number of segments in the blk-mq submission path.
> Remove the field from struct bio, and return it from a variant of
> blk_queue_split instead of that it can passed as an argument to
> those functions that need the value.
> 
> This also means we stop recounting segments except for cloning
> and partial segments.
> 
> To keep the number of arguments in this how path down remove
> pointless struct request_queue arguments from any of the functions
> that had it and grew a nr_segs argument.
> 
> Signed-off-by: Christoph Hellwig <[email protected]>
> ---
>  Documentation/block/biodoc.txt |  1 -
>  block/bfq-iosched.c            |  5 ++-
>  block/bio.c                    | 15 +------
>  block/blk-core.c               | 32 +++++++--------
>  block/blk-map.c                | 10 ++++-
>  block/blk-merge.c              | 75 ++++++++++++----------------------
>  block/blk-mq-sched.c           | 26 +++++++-----
>  block/blk-mq-sched.h           | 10 +++--
>  block/blk-mq.c                 | 23 ++++++-----
>  block/blk.h                    | 23 ++++++-----
>  block/kyber-iosched.c          |  5 ++-
>  block/mq-deadline.c            |  5 ++-
>  drivers/md/raid5.c             |  1 -
>  include/linux/bio.h            |  1 -
>  include/linux/blk-mq.h         |  2 +-
>  include/linux/blk_types.h      |  6 ---
>  include/linux/blkdev.h         |  1 -
>  include/linux/elevator.h       |  2 +-
>  18 files changed, 106 insertions(+), 137 deletions(-)
> 
In general a very good idea, but:

> @@ -304,6 +301,13 @@ void blk_queue_split(struct request_queue *q, struct bio 
> **bio)
>               *bio = split;
>       }
>  }
> +
> +void blk_queue_split(struct request_queue *q, struct bio **bio)
> +{
> +     unsigned int nr_segs;
> +
> +     __blk_queue_split(q, bio, &nr_segs);
> +}
>  EXPORT_SYMBOL(blk_queue_split);
>  
That looks a bit weird, and I guess some or other compiler might
complain here about nr_segs being unused.
Can't we modify __blk_queue_split() to accept a NULL argument here?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Teamlead Storage & Networking
[email protected]                                   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)

Reply via email to