OSDN Git Service

file-posix: add tracking of the zone write pointers
authorSam Li <faithilikerun@gmail.com>
Mon, 8 May 2023 05:15:07 +0000 (13:15 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 May 2023 12:17:55 +0000 (08:17 -0400)
commita3c41f06d5a84bc2263e871b1e9fa4daba7edf0f
tree13dfbdfcfb9b079dbd6127e9759d544a3d19f130
parent90fd9746689e865525ddb18cfec925f56159c740
file-posix: add tracking of the zone write pointers

Since Linux doesn't have a user API to issue zone append operations to
zoned devices from user space, the file-posix driver is modified to add
zone append emulation using regular writes. To do this, the file-posix
driver tracks the wp location of all zones of the device. It uses an
array of uint64_t. The most significant bit of each wp location indicates
if the zone type is conventional zones.

The zones wp can be changed due to the following operations issued:
- zone reset: change the wp to the start offset of that zone
- zone finish: change to the end location of that zone
- write to a zone
- zone append

Signed-off-by: Sam Li <faithilikerun@gmail.com>
Message-id: 20230508051510.177850-2-faithilikerun@gmail.com
[Fix errno propagation from handle_aiocb_zone_mgmt()
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/file-posix.c
include/block/block-common.h
include/block/block_int-common.h