lkml.org 
[lkml]   [2023]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/7] block: add a new helper bdev_{is_zone_start, offset_from_zone_start}
From
On 1/6/23 00:33, Pankaj Raghav wrote:
> +static inline sector_t bdev_offset_from_zone_start(struct block_device *bdev,
> + sector_t sec)
> +{
> + if (!bdev_is_zoned(bdev))
> + return 0;
> +
> + return sec & (bdev_zone_sectors(bdev) - 1);
> +}
> +
> +static inline bool bdev_is_zone_start(struct block_device *bdev, sector_t sec)
> +{
> + if (!bdev_is_zoned(bdev))
> + return false;
> +
> + return bdev_offset_from_zone_start(bdev, sec) == 0;
> +}

A nit: 'sector_t sector' is much more common in the block layer than
'sector_t sec'. Please consider changing 'sec' into 'sector'.

Thanks,

Bart.

\
 
 \ /
  Last update: 2023-03-26 23:31    [W:0.169 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site