lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 28 Jun 2023 11:45:34 -0500
From:   Bill O'Donnell <billodo@...hat.com>
To:     Yangtao Li <frank.li@...o.com>
Cc:     axboe@...nel.dk, song@...nel.org, viro@...iv.linux.org.uk,
        brauner@...nel.org, xiang@...nel.org, chao@...nel.org,
        huyue2@...lpad.com, jefflexu@...ux.alibaba.com, hch@...radead.org,
        djwong@...nel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
        linux-xfs@...r.kernel.org
Subject: Re: [PATCH 1/7] block: add queue_logical_block_mask() and
 bdev_logical_block_mask()

On Wed, Jun 28, 2023 at 05:34:54PM +0800, Yangtao Li wrote:
> Introduce queue_logical_block_mask() and bdev_logical_block_mask()
> to simplify code, which replace (queue_logical_block_size(q) - 1)
> and (bdev_logical_block_size(bdev) - 1).
> 
> Signed-off-by: Yangtao Li <frank.li@...o.com>

Looks fine.
Reviewed-by: Bill O'Donnell <bodonnel@...hat.com>

> ---
>  include/linux/blkdev.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index ed44a997f629..0cc0d1694ef6 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1150,11 +1150,21 @@ static inline unsigned queue_logical_block_size(const struct request_queue *q)
>  	return retval;
>  }
>  
> +static inline unsigned int queue_logical_block_mask(const struct request_queue *q)
> +{
> +	return queue_logical_block_size(q) - 1;
> +}
> +
>  static inline unsigned int bdev_logical_block_size(struct block_device *bdev)
>  {
>  	return queue_logical_block_size(bdev_get_queue(bdev));
>  }
>  
> +static inline unsigned int bdev_logical_block_mask(struct block_device *bdev)
> +{
> +	return bdev_logical_block_size(bdev) - 1;
> +}
> +
>  static inline unsigned int queue_physical_block_size(const struct request_queue *q)
>  {
>  	return q->limits.physical_block_size;
> -- 
> 2.39.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ