diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2019-02-21 16:22:16 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-03-07 23:59:18 -0500 |
commit | c5c0ce75aba6461b6fe42368bbdcbf459a94d62d (patch) | |
tree | ff78c43fa5042a12c47be05229465ea61726a552 | |
parent | bef3ff7f1e5e81bf9734b2f73f0ef26447358805 (diff) | |
download | virtio-spec-c5c0ce75aba6461b6fe42368bbdcbf459a94d62d.tar.gz |
virtio-blk: move virtio_blk_discard_write_zeroes definition
struct virtio_blk_discard_write_zeroes is defined alongside
struct virtio_blk_req but only discussed later in the text. Move it to
where it belongs.
Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | content.tex | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/content.tex b/content.tex index 56fe7ac..2adeb62 100644 --- a/content.tex +++ b/content.tex @@ -3944,15 +3944,6 @@ struct virtio_blk_req { u8 data[]; u8 status; }; - -struct virtio_blk_discard_write_zeroes { - le64 sector; - le32 num_sectors; - struct { - le32 unmap:1; - le32 reserved:31; - } flags; -}; \end{lstlisting} The type of the request is either a read (VIRTIO_BLK_T_IN), a write @@ -3977,10 +3968,22 @@ requests write the contents of \field{data} to the block device (in multiples of 512 bytes). The \field{data} used for discard or write zeroes command is described -by one or more virtio_blk_discard_write_zeroes structs. \field{sector} -indicates the starting offset (in 512-byte units) of the segment, while -\field{num_sectors} indicates the number of sectors in each discarded -range. \field{unmap} is only used for write zeroes command. +by one or more virtio_blk_discard_write_zeroes structs: + +\begin{lstlisting} +struct virtio_blk_discard_write_zeroes { + le64 sector; + le32 num_sectors; + struct { + le32 unmap:1; + le32 reserved:31; + } flags; +}; +\end{lstlisting} + +\field{sector} indicates the starting offset (in 512-byte units) of the +segment, while \field{num_sectors} indicates the number of sectors in each +discarded range. \field{unmap} is only used for write zeroes command. The final \field{status} byte is written by the device: either VIRTIO_BLK_S_OK for success, VIRTIO_BLK_S_IOERR for device or driver |