From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Van Hensbergen Subject: Re: [V9fs-developer] [RFC PATCH -V2 01/17] fs/9p: set the cached file_operations struct during inode init Date: Mon, 7 Feb 2011 09:02:11 -0600 Message-ID: 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=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: "Aneesh Kumar K.V" Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:44877 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753788Ab1BGPCM convert rfc822-to-8bit (ORCPT ); Mon, 7 Feb 2011 10:02:12 -0500 In-Reply-To: <1296928005-9529-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Feb 5, 2011 at 11:46 AM, Aneesh Kumar K.V wrote: > =A0/** > =A0* v9fs_file_open - open a file (or directory) > =A0* @inode: inode to be opened > @@ -89,19 +86,12 @@ int v9fs_file_open(struct inode *inode, struct fi= le *file) > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0file->private_data =3D fid; > +#ifdef CONFIG_9P_FSCACHE > =A0 =A0 =A0 =A0if ((fid->qid.version) && (v9ses->cache)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0P9_DPRINTK(P9_DEBUG_VFS, "cached"); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* enable cached file options */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if(file->f_op =3D=3D &v9fs_file_operati= ons) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 file->f_op =3D &v9fs_ca= ched_file_operations; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 else if (file->f_op =3D=3D &v9fs_file_o= perations_dotl) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 file->f_op =3D &v9fs_ca= ched_file_operations_dotl; > - > -#ifdef CONFIG_9P_FSCACHE > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0v9fs_cache_inode_set_cookie(inode, fil= e); > -#endif > =A0 =A0 =A0 =A0} > - > +#endif > =A0 =A0 =A0 =A0return 0; > =A0} Doesn't this conditionalize all cached operations on FSCACHE operation? What if we want loose cache policy without FSCACHE? -eric -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html