zbd: introduce zbd_offset_to_zone() helper
Introduce the helper function zbd_offset_to_zone() to get a zone
structure using a file offset. In many functions, this replaces the
two line code pattern:
zone_idx = zbd_offset_to_zone_idx(f, offset);
z = zbd_get_zone(f, zone_idx);
with a single line of code:
z = zbd_offset_to_zone(f, offset);
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-12-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>