[dm-devel] [PATCH 03/16] block: add bdev_zone_no helper

2022-04-29 Thread Pankaj Raghav
Many places in the filesystem for zoned devices open code this function to find the zone number for a given sector with power of 2 assumption. This generic helper can be used to calculate zone number for a given sector in a block device This helper internally uses blk_queue_zone_no to find the zon

Re: [dm-devel] [PATCH 03/16] block: add bdev_zone_no helper

2022-04-27 Thread Bart Van Assche
On 4/27/22 09:02, Pankaj Raghav wrote: +static inline unsigned int bdev_zone_no(struct block_device *bdev, sector_t sec) +{ + struct request_queue *q = bdev_get_queue(bdev); + + if (q) + return blk_queue_zone_no(q, sec); + return 0; +} This patch series has been