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

BACKPORT: FROMLIST: block: make bdev_nr_zones and disk_zone_no generic for npo2 zone size



Adapt bdev_nr_zones and disk_zone_no functions so that they can
also work for non-power-of-2 zone sizes.

As the existing deployments assume that a device zone size is a power of
2 number of sectors, power-of-2 optimized calculation is used for those
devices.

There are no direct hot paths modified and the changes just
introduce one new branch per call.

Reviewed-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Reviewed-by: default avatarAdam Manzanares <a.manzanares@samsung.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarPankaj Raghav <p.raghav@samsung.com>
Bug: 197782466
Bug: 269471019
Link: https://lore.kernel.org/linux-block/20220923173618.6899-2-p.raghav@samsung.com/


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