Re: [PATCH 4/5] block: move bio_allowed_max_sectors to blk-merge.c

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

 



On 7/20/22 23:24, Christoph Hellwig wrote:
> Move this helper into the only file where it is used.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>

> ---
>  block/blk-merge.c | 10 ++++++++++
>  block/blk.h       | 10 ----------
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index 1676a835b16e7..9593a8a617292 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -95,6 +95,16 @@ static inline bool req_gap_front_merge(struct request *req, struct bio *bio)
>  	return bio_will_gap(req->q, NULL, bio, req->bio);
>  }
>  
> +/*
> + * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size
> + * is defined as 'unsigned int', meantime it has to aligned to with logical
> + * block size which is the minimum accepted unit by hardware.
> + */
> +static unsigned int bio_allowed_max_sectors(struct request_queue *q)
> +{
> +	return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9;
> +}
> +
>  static struct bio *blk_bio_discard_split(struct request_queue *q,
>  					 struct bio *bio,
>  					 struct bio_set *bs,
> diff --git a/block/blk.h b/block/blk.h
> index c4b084bfe87c9..3026ba81c85f0 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -349,16 +349,6 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req)
>  		q->last_merge = NULL;
>  }
>  
> -/*
> - * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size
> - * is defined as 'unsigned int', meantime it has to aligned to with logical
> - * block size which is the minimum accepted unit by hardware.
> - */
> -static inline unsigned int bio_allowed_max_sectors(struct request_queue *q)
> -{
> -	return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9;
> -}
> -
>  /*
>   * Internal io_context interface
>   */


-- 
Damien Le Moal
Western Digital Research



[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