qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <gkurz@linux.vnet.ibm.com>,
	Wei Liu <wei.liu2@citrix.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH v2 18/27] 9pfs: factor out pdu_push_and_notify
Date: Thu, 7 Jan 2016 19:56:15 +0000	[thread overview]
Message-ID: <1452196584-17259-19-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1452196584-17259-1-git-send-email-wei.liu2@citrix.com>

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 hw/9pfs/virtio-9p.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 498e327..af9b1d1 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -63,6 +63,17 @@ ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
     return ret;
 }
 
+static void pdu_push_and_notify(V9fsPDU *pdu)
+{
+    V9fsState *s = pdu->s;
+
+    /* push onto queue and notify */
+    virtqueue_push(s->vq, &pdu->elem, pdu->size);
+
+    /* FIXME: we should batch these completions */
+    virtio_notify(VIRTIO_DEVICE(s), s->vq);
+}
+
 static int omode_to_uflags(int8_t mode)
 {
     int ret = 0;
@@ -653,11 +664,7 @@ static void pdu_complete(V9fsPDU *pdu, ssize_t len)
     pdu->size = len;
     pdu->id = id;
 
-    /* push onto queue and notify */
-    virtqueue_push(s->vq, &pdu->elem, len);
-
-    /* FIXME: we should batch these completions */
-    virtio_notify(VIRTIO_DEVICE(s), s->vq);
+    pdu_push_and_notify(pdu);
 
     /* Now wakeup anybody waiting in flush for this request */
     qemu_co_queue_next(&pdu->complete);
-- 
2.1.4

  parent reply	other threads:[~2016-01-07 20:03 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 19:55 [Qemu-devel] [PATCH v2 00/27] 9pfs: disentangling virtio and generic code Wei Liu
2016-01-07 19:55 ` [Qemu-devel] [PATCH v2 01/27] 9pfs: rename virtio-9p-coth.{c, h} to coth.{c, h} Wei Liu
2016-01-07 19:55 ` [Qemu-devel] [PATCH v2 02/27] 9pfs: rename virtio-9p-handle.c to 9p-handle.c Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 03/27] 9pfs: rename virtio-9p-local.c to 9p-local.c Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 04/27] 9pfs: rename virtio-9p-posix-acl.c to 9p-posix-acl.c Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 05/27] 9pfs: rename virtio-9p-proxy.{c, h} to 9p-proxy.{c, h} Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 06/27] 9pfs: rename virtio-9p-synth.{c, h} to 9p-synth.{c, h} Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 07/27] 9pfs: rename virtio-9p-xattr{, -user}.{c, h} to 9p-xattr{, -user}.{c, h} Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 08/27] 9pfs: merge hw/virtio/virtio-9p.h into hw/9pfs/virtio-9p.h Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 09/27] 9pfs: remove dead code Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 10/27] fsdev: break out 9p-marshal.{c, h} from virtio-9p-marshal.{c, h} Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 11/27] fsdev: 9p-marshal: introduce V9fsBlob Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 12/27] 9pfs: use V9fsBlob to transmit xattr Wei Liu
2016-01-08  8:30   ` Aneesh Kumar K.V
2016-01-08 17:56     ` Wei Liu
2016-01-08 18:48       ` Aneesh Kumar K.V
2016-01-08 18:54         ` Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 13/27] fsdev: rename virtio-9p-marshal.{c, h} to 9p-iov-marshal.{c, h} Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 14/27] 9pfs: PDU processing functions don't need to take V9fsState as argument Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 15/27] 9pfs: PDU processing functions should start pdu_ prefix Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 16/27] 9pfs: make pdu_{, un}marshal proper functions Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 17/27] 9pfs: factor out virtio_pdu_{, un}marshal Wei Liu
2016-01-07 19:56 ` Wei Liu [this message]
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 19/27] 9pfs: break out virtio_init_iov_from_pdu Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 20/27] 9pfs: break out 9p.h from virtio-9p.h Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 21/27] 9pfs: factor out virtio_9p_push_and_notify Wei Liu
2016-01-08  9:57   ` Aneesh Kumar K.V
2016-01-08 17:57     ` Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 22/27] 9pfs: export pdu_{submit, alloc, free} Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 23/27] 9pfs: move handle_9p_output and make it static function Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 24/27] 9pfs: rename virtio_9p_set_fd_limit to use v9fs_ prefix Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 25/27] 9pfs: rename virtio-9p.c to 9p.c Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 26/27] 9pfs: factor out v9fs_device_{, un}realize_common Wei Liu
2016-01-07 19:56 ` [Qemu-devel] [PATCH v2 27/27] 9pfs: disentangle V9fsState Wei Liu
2016-01-08  6:09   ` Aneesh Kumar K.V
2016-01-08 18:54     ` Wei Liu
2016-01-08 10:49 ` [Qemu-devel] [PATCH v2 00/27] 9pfs: disentangling virtio and generic code Aneesh Kumar K.V
2016-01-08 18:54   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452196584-17259-19-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).