engines/libzbc: Enable trim for libzbc I/O engine
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 6 Aug 2021 01:07:09 +0000 (10:07 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 6 Aug 2021 22:39:28 +0000 (16:39 -0600)
commit84f07387d900ae9e06ce7b3eadf13273a577b7ca
tree883a14a99fb16434ec6dc57aaf96f34880baa201
parente3be810bf0fdb9f5f50c2871974afb6021cad775
engines/libzbc: Enable trim for libzbc I/O engine

The trim workload to zoned block devices is supported as zone reset, and
this feature is available for I/O engines which support both zoned
devices and trim workload. Libzbc I/O engine supports zoned devices but
lacks trim workload support. To enable trim support with libzbc I/O
engine, remove the check which inhibited trim from requests to libzbc
I/O engine. Also set file open flags for trim same as write, and call
zbd_do_io_u_trim() for trim I/O.

Of note is that libzbc I/O engine now can support trim to sequential
write required zones only. The trim I/Os to conventional zones are
reported as an error.

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