[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH -V4 04/26] [virtio-9p] Remove post functions for v9f
From: |
Aneesh Kumar K.V |
Subject: |
[Qemu-devel] [PATCH -V4 04/26] [virtio-9p] Remove post functions for v9fs_readlink. |
Date: |
Mon, 8 Aug 2011 22:33:52 +0530 |
From: Venkateswararao Jujjuri (JV) <address@hidden>
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>
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
hw/9pfs/virtio-9p.c | 29 +++++++++--------------------
1 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 113ce1e..fa83058 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -1949,13 +1949,13 @@ static void v9fs_read_post_seekdir(V9fsState *s,
V9fsReadState *vs, ssize_t err)
if (err) {
goto out;
}
- v9fs_stat_free(&vs->v9stat);
- v9fs_string_free(&vs->name);
vs->offset += pdu_marshal(vs->pdu, vs->offset, "d", vs->count);
vs->offset += vs->count;
err = vs->offset;
out:
complete_pdu(s, vs->pdu, err);
+ v9fs_stat_free(&vs->v9stat);
+ v9fs_string_free(&vs->name);
qemu_free(vs);
return;
}
@@ -3582,21 +3582,6 @@ out:
qemu_free(vs);
}
-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)
{
V9fsPDU *pdu = opaque;
@@ -3611,7 +3596,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;
@@ -3620,10 +3604,15 @@ 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;
out:
complete_pdu(s, vs->pdu, err);
+ v9fs_string_free(&vs->target);
qemu_free(vs);
}
--
1.7.4.1
- [Qemu-devel] [PATCHSET 1] VirtFS coroutine changes, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 07/26] [virtio-9p] Remove post functions for v9fs_mkdir., Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 01/26] coroutine: add gthread dependency, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 05/26] [virtio-9p] clean up v9fs_readlink., Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 06/26] [virtio-9p] coroutines for readlink, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 09/26] hw/9pfs: Add yield support for readdir related coroutines, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 04/26] [virtio-9p] Remove post functions for v9fs_readlink.,
Aneesh Kumar K.V <=
- [Qemu-devel] [PATCH -V4 03/26] [virtio-9p] Change all pdu handlers to coroutines., Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 10/26] hw/9pfs: Update v9fs_readdir to use coroutines, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 12/26] hw/9pfs: Update v9fs_statfs to use coroutines, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 13/26] hw/9pfs: Add yield support to lstat coroutine, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 02/26] [virtio-9p] Add infrastructure to support glib threads and coroutines., Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 14/26] hw/9pfs: Update v9fs_getattr to use coroutines, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 15/26] hw/9pfs: Add yield support to setattr related coroutines, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 17/26] hw/9pfs: Add yield support to xattr related coroutine, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 16/26] hw/9pfs: Update v9fs_setattr to use coroutines, Aneesh Kumar K.V, 2011/08/08
- [Qemu-devel] [PATCH -V4 18/26] hw/9pfs: Update v9fs_xattrwalk to coroutines, Aneesh Kumar K.V, 2011/08/08