[PATCH 2/2] nbd/proto: add NBD_CMD_WRITE_ZEROES64
Add new structured request type to represent 64bit version of
NBD_CMD_WRITE_ZEROES.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
doc/proto.md | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/doc/proto.md b/doc/proto.md
index cb0ac56..378a800 100644
--- a/doc/proto.md
+++ b/doc/proto.md
@@ -1096,6 +1096,8 @@ The field has the following format:
is set.
- bit 12, `NBD_FLAG_STRUCTURED_REQUEST`; allow clients to use
structured requests.
+- bit 13, `NBD_FLAG_SEND_WRITE_ZEROES64`: documents that the server
+ understands `NBD_CMD_WRITE_ZEROES64` structured request chunk type.
Clients SHOULD ignore unknown flags.
@@ -1866,6 +1868,25 @@ NBD_STRUCTURED_FLAG_DONE (NBD_NONE_CHUNK may be used for this).
represents a no-op command, which SHOULD be replied with no errors and
may be used like ping, to check server availability.
+* `NBD_CMD_WRITE_ZEROES64` (6)
+
+ NBD_CMD_WRITE_ZEROES representation with 64bit length.
+
+ The payload is structured as:
+
+ 16 bits: command flags
+ 64 bits: offset (unsigned)
+ 64 bits: length (unsigned)
+
+ The fields has exactly same meaning as corresponding fields for
+ NBD_CMD_WRITE_ZEROES request.
+
+ This request chunk type MUST be the only one chunk of the structured message
+ and therefore MUST be accompanied by NBD_STRUCTURED_FLAG_DONE.
+
+ This request chunk type is negotiated by server flag
+ NBD_FLAG_SEND_WRITE_ZEROES64, and MUST not be used otherwise.
+
#### Request types
The following request types exist:
@@ -2138,6 +2159,11 @@ The following request types exist:
including one or more sectors beyond the size of the device. It SHOULD
return `NBD_EPERM` if it receives a write zeroes request on a read-only export.
+ If structured requests are negotieated by server, client MAY use
+ 64bit variant of the command, which has exactly same behavior and
+ the only differency is 64bit length field. See NBD_CMD_WRITE_ZEROES64
+ above.
+
* `NBD_CMD_BLOCK_STATUS` (7)
A block status query request. Length and offset define the range
--
2.21.0
Reply to: