From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMtQb-0005GE-PJ for qemu-devel@nongnu.org; Wed, 18 May 2011 22:57:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMtQa-0004tu-Lz for qemu-devel@nongnu.org; Wed, 18 May 2011 22:57:33 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:57276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMtQa-0004tj-FT for qemu-devel@nongnu.org; Wed, 18 May 2011 22:57:32 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p4J2hY2T024057 for ; Wed, 18 May 2011 20:43:34 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4J2vOAT130326 for ; Wed, 18 May 2011 20:57:24 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4IKuuhV015221 for ; Wed, 18 May 2011 14:56:56 -0600 From: "Venkateswararao Jujjuri (JV)" Date: Wed, 18 May 2011 19:56:56 -0700 Message-Id: <1305773834-16359-7-git-send-email-jvrao@linux.vnet.ibm.com> In-Reply-To: <1305773834-16359-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1305773834-16359-1-git-send-email-jvrao@linux.vnet.ibm.com> Subject: [Qemu-devel] [V3 06/24] [virtio-9p] Remove post functions for v9fs_mkdir. 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)" , stefanha@linux.vnet.ibm.com Signed-off-by: Venkateswararao Jujjuri " --- hw/9pfs/virtio-9p.c | 52 ++++++++++++-------------------------------------- 1 files changed, 13 insertions(+), 39 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 3e0d933..f2794d4 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -3308,40 +3308,6 @@ out: qemu_free(vs); } -static void v9fs_mkdir_post_lstat(V9fsState *s, V9fsMkState *vs, int err) -{ - if (err == -1) { - err = -errno; - goto out; - } - - stat_to_qid(&vs->stbuf, &vs->qid); - vs->offset += pdu_marshal(vs->pdu, vs->offset, "Q", &vs->qid); - err = vs->offset; -out: - complete_pdu(s, vs->pdu, err); - v9fs_string_free(&vs->fullname); - v9fs_string_free(&vs->name); - qemu_free(vs); -} - -static void v9fs_mkdir_post_mkdir(V9fsState *s, V9fsMkState *vs, int err) -{ - if (err == -1) { - err = -errno; - goto out; - } - - err = v9fs_do_lstat(s, &vs->fullname, &vs->stbuf); - v9fs_mkdir_post_lstat(s, vs, err); - return; -out: - complete_pdu(s, vs->pdu, err); - v9fs_string_free(&vs->fullname); - v9fs_string_free(&vs->name); - qemu_free(vs); -} - static void v9fs_mkdir(void *opaque) { V9fsPDU *pdu = opaque; @@ -3359,19 +3325,27 @@ static void v9fs_mkdir(void *opaque) v9fs_string_init(&vs->fullname); pdu_unmarshal(vs->pdu, vs->offset, "dsdd", &fid, &vs->name, &mode, - &gid); + &gid); fidp = lookup_fid(s, fid); if (fidp == NULL) { err = -ENOENT; goto out; } - v9fs_string_sprintf(&vs->fullname, "%s/%s", fidp->path.data, vs->name.data); err = v9fs_do_mkdir(s, vs->fullname.data, mode, fidp->uid, gid); - v9fs_mkdir_post_mkdir(s, vs, err); - return; - + if (err == -1) { + err = -errno; + goto out; + } + err = v9fs_do_lstat(s, &vs->fullname, &vs->stbuf); + if (err == -1) { + err = -errno; + goto out; + } + stat_to_qid(&vs->stbuf, &vs->qid); + vs->offset += pdu_marshal(vs->pdu, vs->offset, "Q", &vs->qid); + err = vs->offset; out: complete_pdu(s, vs->pdu, err); v9fs_string_free(&vs->fullname); -- 1.7.1