Received: from eggs.gnu.org ([140.186.70.92]:60157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTJq-0006mr-Nc for qemu-devel@nongnu.org; Mon, 08 Aug 2011 13:08:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqTJp-0002Ss-W2 for qemu-devel@nongnu.org; Mon, 08 Aug 2011 13:08:50 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:58799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTJp-0002Sl-D7 for qemu-devel@nongnu.org; Mon, 08 Aug 2011 13:08:49 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp06.au.ibm.com (8.14.4/8.13.1) with ESMTP id p78H7u9C021543 for ; Tue, 9 Aug 2011 03:07:56 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p78H6bQb1257544 for ; Tue, 9 Aug 2011 03:06:37 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p78H7Wkw027098 for ; Tue, 9 Aug 2011 03:07:33 +1000 From: "Aneesh Kumar K.V" Date: Mon, 8 Aug 2011 22:36:45 +0530 Message-Id: <1312823215-28675-19-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1312823215-28675-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1312823215-28675-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V4 18/28] [virtio-9p] Remove post functions for v9fs_symlink List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, "Venkateswararao Jujjuri (JV)" , "Aneesh Kumar K.V" From: Venkateswararao Jujjuri (JV) Signed-off-by: Venkateswararao Jujjuri " Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p.c | 47 +++++++++++++++-------------------------------- 1 files changed, 15 insertions(+), 32 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 68b18d6..35de63a 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -2119,33 +2119,6 @@ out: v9fs_string_free(&fullname); } -static void v9fs_post_symlink(V9fsState *s, V9fsSymlinkState *vs, int err) -{ - if (err == 0) { - stat_to_qid(&vs->stbuf, &vs->qid); - vs->offset += pdu_marshal(vs->pdu, vs->offset, "Q", &vs->qid); - err = vs->offset; - } else { - err = -errno; - } - complete_pdu(s, vs->pdu, err); - v9fs_string_free(&vs->name); - v9fs_string_free(&vs->symname); - v9fs_string_free(&vs->fullname); - qemu_free(vs); -} - -static void v9fs_symlink_post_do_symlink(V9fsState *s, V9fsSymlinkState *vs, - int err) -{ - if (err) { - goto out; - } - err = v9fs_do_lstat(s, &vs->fullname, &vs->stbuf); -out: - v9fs_post_symlink(s, vs, err); -} - static void v9fs_symlink(void *opaque) { V9fsPDU *pdu = opaque; @@ -2171,16 +2144,26 @@ static void v9fs_symlink(void *opaque) } v9fs_string_sprintf(&vs->fullname, "%s/%s", vs->dfidp->path.data, - vs->name.data); + vs->name.data); err = v9fs_do_symlink(s, vs->dfidp, vs->symname.data, - vs->fullname.data, gid); - v9fs_symlink_post_do_symlink(s, vs, err); - return; - + vs->fullname.data, gid); + if (err < 0) { + err = -errno; + goto out; + } + err = v9fs_do_lstat(s, &vs->fullname, &vs->stbuf); + if (err == 0) { + stat_to_qid(&vs->stbuf, &vs->qid); + vs->offset += pdu_marshal(vs->pdu, vs->offset, "Q", &vs->qid); + err = vs->offset; + } else { + err = -errno; + } out: complete_pdu(s, vs->pdu, err); v9fs_string_free(&vs->name); v9fs_string_free(&vs->symname); + v9fs_string_free(&vs->fullname); qemu_free(vs); } -- 1.7.4.1