From: "Aneesh Kumar K. V" Subject: Re: [V9fs-developer] [RFC PATCH -V2 01/17] fs/9p: set the cached file_operations struct during inode init Date: Tue, 08 Feb 2011 14:17:54 +0530 Message-ID: <87zkq6hpz9.fsf@linux.vnet.ibm.com> References: <1296928005-9529-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1296928005-9529-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Eric Van Hensbergen Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, 7 Feb 2011 09:02:11 -0600, Eric Van Hensbergen wrote: > On Sat, Feb 5, 2011 at 11:46 AM, Aneesh Kumar K.V > wrote: >=20 > > =C2=A0/** > > =C2=A0* v9fs_file_open - open a file (or directory) > > =C2=A0* @inode: inode to be opened > > @@ -89,19 +86,12 @@ int v9fs_file_open(struct inode *inode, struct = file *file) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0file->private_data =3D fid; > > +#ifdef CONFIG_9P_FSCACHE > > =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((fid->qid.version) && (v9ses->cache)= ) { > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0P9_DPRINTK(P= 9_DEBUG_VFS, "cached"); > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* enable cached= file options */ > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if(file->f_op =3D= =3D &v9fs_file_operations) > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 file->f_op =3D &v9fs_cached_file_operations; > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else if (file->f= _op =3D=3D &v9fs_file_operations_dotl) > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 file->f_op =3D &v9fs_cached_file_operations_dotl; > > - > > -#ifdef CONFIG_9P_FSCACHE > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0v9fs_cache_i= node_set_cookie(inode, file); > > -#endif > > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > > - > > +#endif > > =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; > > =C2=A0} >=20 > Doesn't this conditionalize all cached operations on FSCACHE operatio= n? > What if we want loose cache policy without FSCACHE? >=20 we set file_operations is set in inode init now. The only remaining par= t=20 is v9fs_cache_inode_set_cookie which is FSCACHE specific -aneesh