Commit c5c1ebb7 authored by Pankaj Raghav's avatar Pankaj Raghav Committed by Treehugger Robot
Browse files

BACKPORT: FROMLIST: block: introduce bdev_zone_no helper



Add a generic bdev_zone_no() helper to calculate zone number for a
given sector in a block device. This helper internally uses disk_zone_no()
to find the zone number.

Use the helper bdev_zone_no() to calculate nr of zones. This lets us
make modifications to the math if needed in one place.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarPankaj Raghav <p.raghav@samsung.com>
Bug: 197782466
Bug: 269471019
Link: https://lore.kernel.org/linux-block/20230110143635.77300-4-p.raghav@samsung.com/


Change-Id: I86d97c0a64db5ebe1be725710accdaf6e8346d9e
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 610058c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment