zbd: remove dependency on zone type during i/o
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Wed, 27 Jan 2021 04:19:13 +0000 (13:19 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 29 Jan 2021 15:14:00 +0000 (08:14 -0700)
commitbe7a6baed58f19df27bc4495573610b8301c98ae
tree531ed9bfc8b802057a8e8dbc6abe9326c94d75aa
parent59b67452b9dab3ad2bc9f1d1dd17c5e3993a66ee
zbd: remove dependency on zone type during i/o

Two different type of zones have a write pointer: Sequential Write
Required (SWR) and Sequential Write Preferred (SWP). Introduce the
zone flag "has_wp" in struct zbd_zone_info and set it to 1 for these
zone types upon initialization, thus avoiding the necessity to check
multiple zone types in core zbd code. This flag replaces zbd_zone_swr()
function and lays the groundwork for supporting additional write
pointer zone types in the future.

The overall functionality stays the same after this commit.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c
zbd.h