From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45638 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuIk3-0003pj-Mo for qemu-devel@nongnu.org; Tue, 01 Mar 2011 01:07:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuIk2-0007C1-Bj for qemu-devel@nongnu.org; Tue, 01 Mar 2011 01:07:27 -0500 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:52377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuIk1-0007Bh-Pi for qemu-devel@nongnu.org; Tue, 01 Mar 2011 01:07:26 -0500 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp08.au.ibm.com (8.14.4/8.13.1) with ESMTP id p2162ArO027795 for ; Tue, 1 Mar 2011 17:02:10 +1100 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2167Ekd2236656 for ; Tue, 1 Mar 2011 17:07:17 +1100 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 p2167DHn006644 for ; Tue, 1 Mar 2011 17:07:14 +1100 From: "Aneesh Kumar K. V" Subject: Re: [Qemu-devel] [RFC PATCH -V1 3/4] hw/9pfs: Implement syncfs In-Reply-To: <4D6C5072.9030301@linux.vnet.ibm.com> References: <1296929291-11047-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1296929291-11047-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <4D6C5072.9030301@linux.vnet.ibm.com> Date: Tue, 01 Mar 2011 11:37:06 +0530 Message-ID: <87tyfngyr9.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Venkateswararao Jujjuri (JV)" Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Mon, 28 Feb 2011 17:48:34 -0800, "Venkateswararao Jujjuri (JV)" wrote: > On 2/5/2011 10:08 AM, Aneesh Kumar K.V wrote: > > Signed-off-by: Aneesh Kumar K.V > > --- > > hw/9pfs/virtio-9p.c | 31 +++++++++++++++++++++++++++++++ > > hw/9pfs/virtio-9p.h | 2 ++ > > 2 files changed, 33 insertions(+), 0 deletions(-) > > > > diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c > > index 2d9ca11..1518e00 100644 > > --- a/hw/9pfs/virtio-9p.c > > +++ b/hw/9pfs/virtio-9p.c > > @@ -1978,6 +1978,36 @@ static void v9fs_fsync(V9fsState *s, V9fsPDU *pdu) > > v9fs_post_do_fsync(s, pdu, err); > > } > > > > +static void v9fs_post_do_syncfs(V9fsState *s, V9fsPDU *pdu, int err) > > +{ > > + if (err == -1) { > > + err = -errno; > > + } > > + complete_pdu(s, pdu, err); > > +} > > + > > +static void v9fs_syncfs(V9fsState *s, V9fsPDU *pdu) > > +{ > > + int err; > > + int32_t fid; > > + size_t offset = 7; > > + V9fsFidState *fidp; > > + > > + pdu_unmarshal(pdu, offset, "d", &fid); > > + fidp = lookup_fid(s, fid); > > + if (fidp == NULL) { > > + err = -ENOENT; > > + v9fs_post_do_syncfs(s, pdu, err); > > + return; > > + } > > + /* > > + * We don't have per file system syncfs > > + * So just return success > > + */ > > + err = 0; > > How about > > err = 0 > if (fidp == NULL) > err = -ENOENT > That err = 0 will go away once we get the below support in the kernel. http://thread.gmane.org/gmane.linux.file-systems/44628 -aneesh