From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-5356-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 7FE12985F2F for ; Thu, 31 Jan 2019 02:36:41 +0000 (UTC) From: Stefan Hajnoczi Date: Thu, 31 Jan 2019 10:36:15 +0800 Message-Id: <20190131023617.23007-3-stefanha@redhat.com> In-Reply-To: <20190131023617.23007-1-stefanha@redhat.com> References: <20190131023617.23007-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [virtio-dev] [PATCH v2 2/4] virtio-blk: move virtio_blk_discard_write_zeroes definition To: virtio-dev@lists.oasis-open.org Cc: Stefan Hajnoczi , "Michael S . Tsirkin" List-ID: 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 Signed-off-by: Stefan Hajnoczi --- content.tex | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/content.tex b/content.tex index b185bb0..4201c7e 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 -- 2.20.1 --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org