[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/25] 9pfs: factor out pdu_push_and_notify
From: |
Aneesh Kumar K.V |
Subject: |
[Qemu-devel] [PATCH 16/25] 9pfs: factor out pdu_push_and_notify |
Date: |
Tue, 12 Jan 2016 11:38:23 +0530 |
From: Wei Liu <address@hidden>
Signed-off-by: Wei Liu <address@hidden>
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
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 6d32b81faa25..e97adc8ba3f2 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.5.0
- [Qemu-devel] [PATCH 18/25] 9pfs: break out 9p.h from virtio-9p.h, (continued)
- [Qemu-devel] [PATCH 18/25] 9pfs: break out 9p.h from virtio-9p.h, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 10/25] fsdev: break out 9p-marshal.{c, h} from virtio-9p-marshal.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 02/25] 9pfs: rename virtio-9p-handle.c to 9p-handle.c, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 19/25] 9pfs: factor out virtio_9p_push_and_notify, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 11/25] fsdev: rename virtio-9p-marshal.{c, h} to 9p-iov-marshal.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 07/25] 9pfs: rename virtio-9p-xattr{, -user}.{c, h} to 9p-xattr{, -user}.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 14/25] 9pfs: make pdu_{, un}marshal proper functions, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 23/25] 9pfs: rename virtio-9p.c to 9p.c, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 17/25] 9pfs: break out virtio_init_iov_from_pdu, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 20/25] 9pfs: export pdu_{submit,alloc,free}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 16/25] 9pfs: factor out pdu_push_and_notify,
Aneesh Kumar K.V <=
- Re: [Qemu-devel] [PULL 00/25] VirtFS update, Peter Maydell, 2016/01/12