zbd: simplify zone reset code
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Tue, 4 Aug 2020 01:38:27 +0000 (10:38 +0900)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Aug 2020 16:42:42 +0000 (10:42 -0600)
commitceb35a115f30cace0faabfa51a5aeefdd69411cf
treee08fe3f3e67be420026efae0596b179b62a2d2bc
parent162f8c2a96ae181d7e4099af8e9f39b5eac6886e
zbd: simplify zone reset code

zbd_reset_range() function is only called once from zbd_reset_zone()
and it is always called for an individual zone, not a range.

Make zone reset flow simpler by moving all the code needed
to reset a single zone from zbd_reset_range() to zbd_reset_zone().
Therefore, zbd_reset_range() is now dropped.

zbc_reset_zone() is always called with the zone already locked. Remove
recursive zone locking inside this function and add a note in the
description of this function saying that the caller is expected to have
the zone locked when calling it.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c