aboutsummaryrefslogtreecommitdiff
path: root/include/block/block_int-common.h
diff options
context:
space:
mode:
authorSam Li <faithilikerun@gmail.com>2023-05-08 13:15:07 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2023-05-15 08:17:55 -0400
commita3c41f06d5a84bc2263e871b1e9fa4daba7edf0f (patch)
tree13dfbdfcfb9b079dbd6127e9759d544a3d19f130 /include/block/block_int-common.h
parent90fd9746689e865525ddb18cfec925f56159c740 (diff)
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>
Diffstat (limited to 'include/block/block_int-common.h')
-rw-r--r--include/block/block_int-common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index e6975d3933..1674b4745d 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -891,6 +891,8 @@ typedef struct BlockLimits {
/* maximum number of active zones */
uint32_t max_active_zones;
+
+ uint32_t write_granularity;
} BlockLimits;
typedef struct BdrvOpBlocker BdrvOpBlocker;
@@ -1252,6 +1254,9 @@ struct BlockDriverState {
CoMutex bsc_modify_lock;
/* Always non-NULL, but must only be dereferenced under an RCU read guard */
BdrvBlockStatusCache *block_status_cache;
+
+ /* array of write pointers' location of each zone in the zoned device. */
+ BlockZoneWps *wps;
};
struct BlockBackendRootState {