block/nvme: clarify that free_req_queue is protected by q->lock
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 17 Jun 2020 13:21:59 +0000 (14:21 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 23 Jun 2020 14:46:08 +0000 (15:46 +0100)
Existing users access free_req_queue under q->lock. Document this.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200617132201.1832152-6-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/nvme.c

index 8e60882af3ab5e573afc0de800f79bda1ec029b1..426c77e5ab724caf146b80f46f43f16419ba1a19 100644 (file)
@@ -57,7 +57,6 @@ typedef struct {
 } NVMeRequest;
 
 typedef struct {
-    CoQueue     free_req_queue;
     QemuMutex   lock;
 
     /* Fields protected by BQL */
@@ -65,6 +64,7 @@ typedef struct {
     uint8_t     *prp_list_pages;
 
     /* Fields protected by @lock */
+    CoQueue     free_req_queue;
     NVMeQueue   sq, cq;
     int         cq_phase;
     int         free_req_head;