From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTGL-0007mC-Di for qemu-devel@nongnu.org; Mon, 08 Aug 2011 13:05:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqTGK-0001od-8j for qemu-devel@nongnu.org; Mon, 08 Aug 2011 13:05:13 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:45680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTGJ-0001oQ-GV for qemu-devel@nongnu.org; Mon, 08 Aug 2011 13:05:12 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp03.au.ibm.com (8.14.4/8.13.1) with ESMTP id p78GxqIN001327 for ; Tue, 9 Aug 2011 02:59:53 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p78H5AGv1527934 for ; Tue, 9 Aug 2011 03:05:10 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p78H59k8030173 for ; Tue, 9 Aug 2011 03:05:09 +1000 From: "Aneesh Kumar K.V" Date: Mon, 8 Aug 2011 22:34:11 +0530 Message-Id: <1312823054-28331-24-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1312823054-28331-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1312823054-28331-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V4 23/26] [virtio-9p] Remove post functions for v9fs_remove 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 | 26 +++++++------------------- 1 files changed, 7 insertions(+), 19 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 37ba72c..db87a11 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -2579,22 +2579,6 @@ out: complete_pdu(s, pdu, err); } -static void v9fs_remove_post_remove(V9fsState *s, V9fsRemoveState *vs, - int err) -{ - if (err < 0) { - err = -errno; - } else { - err = vs->offset; - } - - /* For TREMOVE we need to clunk the fid even on failed remove */ - free_fid(s, vs->fidp->fid); - - complete_pdu(s, vs->pdu, err); - qemu_free(vs); -} - static void v9fs_remove(void *opaque) { V9fsPDU *pdu = opaque; @@ -2614,11 +2598,15 @@ static void v9fs_remove(void *opaque) err = -EINVAL; goto out; } - err = v9fs_do_remove(s, &vs->fidp->path); - v9fs_remove_post_remove(s, vs, err); - return; + if (err < 0) { + err = -errno; + } else { + err = vs->offset; + } + /* For TREMOVE we need to clunk the fid even on failed remove */ + free_fid(s, vs->fidp->fid); out: complete_pdu(s, pdu, err); qemu_free(vs); -- 1.7.4.1