[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/25] [virtio-9p] Remove post functions for v9fs_re
From: |
Venkateswararao Jujjuri (JV) |
Subject: |
[Qemu-devel] [PATCH 03/25] [virtio-9p] Remove post functions for v9fs_readlink. |
Date: |
Thu, 12 May 2011 13:57:25 -0700 |
In the process of preparation for coroutine threads, remove all post functions
and make the function more readable.
Signed-off-by: Venkateswararao Jujjuri "<address@hidden>
---
hw/9pfs/virtio-9p.c | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index e308e9b..0b38868 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -3637,21 +3637,6 @@ out:
qemu_free(copdu);
}
-static void v9fs_readlink_post_readlink(V9fsState *s, V9fsReadLinkState *vs,
- int err)
-{
- if (err < 0) {
- err = -errno;
- goto out;
- }
- vs->offset += pdu_marshal(vs->pdu, vs->offset, "s", &vs->target);
- err = vs->offset;
-out:
- complete_pdu(s, vs->pdu, err);
- v9fs_string_free(&vs->target);
- qemu_free(vs);
-}
-
static void v9fs_readlink(void *opaque)
{
V9fsCoPdu *copdu = opaque;
@@ -3667,7 +3652,6 @@ static void v9fs_readlink(void *opaque)
vs->offset = 7;
pdu_unmarshal(vs->pdu, vs->offset, "d", &fid);
-
fidp = lookup_fid(s, fid);
if (fidp == NULL) {
err = -ENOENT;
@@ -3676,8 +3660,13 @@ static void v9fs_readlink(void *opaque)
v9fs_string_init(&vs->target);
err = v9fs_do_readlink(s, &fidp->path, &vs->target);
- v9fs_readlink_post_readlink(s, vs, err);
- return;
+ if (err < 0) {
+ err = -errno;
+ goto out;
+ }
+ vs->offset += pdu_marshal(vs->pdu, vs->offset, "s", &vs->target);
+ err = vs->offset;
+ v9fs_string_free(&vs->target);
out:
complete_pdu(s, vs->pdu, err);
qemu_free(vs);
--
1.7.1
- [Qemu-devel] [0/25] Async threading for VirtFS using glib threads & coroutines., Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 05/25] [virtio-9p] Move errno into v9fs_do_readlink, Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 03/25] [virtio-9p] Remove post functions for v9fs_readlink.,
Venkateswararao Jujjuri (JV) <=
- [Qemu-devel] [PATCH 04/25] [virtio-9p] clean up v9fs_readlink., Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 02/25] [virtio-9p] Change all pdu handlers to coroutines., Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 06/25] [virtio-9p] coroutines for readlink, Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 07/25] [virtio-9p] Remove post functions for v9fs_mkdir., Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 14/25] hw/9pfs: Update v9fs_getattr to use coroutines, Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 12/25] hw/9pfs: Update v9fs_statfs to use coroutines, Venkateswararao Jujjuri (JV), 2011/05/12
- [Qemu-devel] [PATCH 01/25] [virtio-9p] Add infrastructure to support glib threads and coroutines., Venkateswararao Jujjuri (JV), 2011/05/12