oslib/linux-blkzoned: Allow reset zone before file set up
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 1 Sep 2020 08:20:01 +0000 (17:20 +0900)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Sep 2020 14:37:36 +0000 (08:37 -0600)
commitb4824992dca5ac9025e6259ae231d93872e7888e
treea7a767df2ace9d18f46e60ed2c0c525d4f65dc23
parentb2da58c4e223f69531d88ff495f8a84ef77f8553
oslib/linux-blkzoned: Allow reset zone before file set up

To reset zones before file set up completion, modify the helper function
blkzoned_reset_wp() to work even when fio_file struct does not have valid
file descriptor yet. If the file descriptor is not available, open and
close the reset target file within the function. Otherwise use the
available descriptor to avoid file open/close overhead.

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>
oslib/linux-blkzoned.c