From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54701 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuLtU-0008OA-1C for qemu-devel@nongnu.org; Tue, 01 Mar 2011 04:29:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuLtS-0006gh-Pn for qemu-devel@nongnu.org; Tue, 01 Mar 2011 04:29:23 -0500 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:59481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuLtS-0006eo-3e for qemu-devel@nongnu.org; Tue, 01 Mar 2011 04:29:22 -0500 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp08.in.ibm.com (8.14.4/8.13.1) with ESMTP id p218bp7T005243 for ; Tue, 1 Mar 2011 14:07:51 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p219TGM82900130 for ; Tue, 1 Mar 2011 14:59:16 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p219TFbm006381 for ; Tue, 1 Mar 2011 20:29:15 +1100 From: "Aneesh Kumar K. V" In-Reply-To: <1298961534-8099-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1298961534-8099-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Date: Tue, 01 Mar 2011 14:58:59 +0530 Message-ID: <87ipw3gpes.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH -V2 1/6] hw/9pfs: Add V9fsfidmap in preparation for adding fd reclaim List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com On Tue, 1 Mar 2011 12:08:49 +0530, "Aneesh Kumar K.V" wrote: > diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h > index 2ae4ce7..2f49641 100644 > --- a/hw/9pfs/virtio-9p.h > +++ b/hw/9pfs/virtio-9p.h > @@ -101,7 +101,10 @@ enum p9_proto_version { > #define P9_NOTAG (u16)(~0) > #define P9_NOFID (u32)(~0) > #define P9_MAXWELEM 16 > +#define P9_FD_RECLAIM_THRES 100 before merge we should change that to 1000. I have updated my local tree. I kept it at 100 to make sure code path get tested when running most of the test case. > > +#define FID_REFERENCED 0x1 > +#define FID_NON_RECLAIMABLE 0x2 > /* > * ample room for Twrite/Rread header > * size[4] Tread/Twrite tag[2] fid[4] offset[8] count[4] > @@ -185,17 +188,22 @@ typedef struct V9fsXattr > int flags; > } V9fsXattr; > > +typedef struct V9fsfidmap { > + union { > + int fd; > + DIR *dir; > + V9fsXattr xattr; > + } fs; > + int fid_type; > + V9fsString path; > + int flags; > +} V9fsFidMap; > + > struct V9fsFidState > { > - int fid_type; > int32_t fid; > - V9fsString path; > - union { > - int fd; > - DIR *dir; > - V9fsXattr xattr; > - } fs; > uid_t uid; > + V9fsFidMap fsmap; > V9fsFidState *next; > }; > -aneesh