From patchwork Mon Aug 8 17:04:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 109021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E9C3FB6F72 for ; Tue, 9 Aug 2011 03:49:22 +1000 (EST) Received: from localhost ([::1]:42092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTHW-0001xx-0r for incoming@patchwork.ozlabs.org; Mon, 08 Aug 2011 13:06:26 -0400 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 Received: from skywalker.ibm.com ([9.80.65.225]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p78H4PcL029309; Tue, 9 Aug 2011 03:05:08 +1000 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Mon, 8 Aug 2011 22:34:11 +0530 Message-Id: <1312823054-28331-24-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 202.81.31.145 Cc: aliguori@us.ibm.com, "Venkateswararao Jujjuri \(JV\)" , "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH -V4 23/26] [virtio-9p] Remove post functions for v9fs_remove X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);