From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 012 of 20] knfsd: nfsd4: make readonly access depend on pseudoflavor Date: Fri, 13 Jul 2007 00:27:04 -0700 Message-ID: <20070713002704.2287f5a3.akpm@linux-foundation.org> References: <20070710121949.12548.patches@notabene> <1070710022615.13375@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: "J. Bruce Fields" , nfs@lists.sourceforge.net, linux-kernel@vger.kernel.org To: NeilBrown Return-path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1I9FYa-00007u-AU for nfs@lists.sourceforge.net; Fri, 13 Jul 2007 00:27:16 -0700 Received: from smtp2.linux-foundation.org ([207.189.120.14]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1I9FYc-0004iG-Qb for nfs@lists.sourceforge.net; Fri, 13 Jul 2007 00:27:20 -0700 In-Reply-To: <1070710022615.13375@suse.de> List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net On Tue, 10 Jul 2007 12:26:15 +1000 NeilBrown wrote: > +static inline int EX_RDONLY(struct svc_export *exp, struct svc_rqst *rqstp) > +{ > + struct exp_flavor_info *f; > + struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; > + > + for (f = exp->ex_flavors; f < end; f++) { > + if (f->pseudoflavor == rqstp->rq_flavor) > + return f->flags & NFSEXP_READONLY; > + } > + return exp->ex_flags & NFSEXP_READONLY; > +} It is fortunate that this inlined monster has only one callsite. otoh, given that it has only one callsite, perhaps it should be private to fs/nfsd/vfs.c. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933849AbXGMH1b (ORCPT ); Fri, 13 Jul 2007 03:27:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753676AbXGMH1X (ORCPT ); Fri, 13 Jul 2007 03:27:23 -0400 Received: from smtp2.linux-foundation.org ([207.189.120.14]:53231 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751117AbXGMH1X (ORCPT ); Fri, 13 Jul 2007 03:27:23 -0400 Date: Fri, 13 Jul 2007 00:27:04 -0700 From: Andrew Morton To: NeilBrown Cc: nfs@lists.sourceforge.net, linux-kernel@vger.kernel.org, "J. Bruce Fields" Subject: Re: [PATCH 012 of 20] knfsd: nfsd4: make readonly access depend on pseudoflavor Message-Id: <20070713002704.2287f5a3.akpm@linux-foundation.org> In-Reply-To: <1070710022615.13375@suse.de> References: <20070710121949.12548.patches@notabene> <1070710022615.13375@suse.de> X-Mailer: Sylpheed 2.4.1 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Jul 2007 12:26:15 +1000 NeilBrown wrote: > +static inline int EX_RDONLY(struct svc_export *exp, struct svc_rqst *rqstp) > +{ > + struct exp_flavor_info *f; > + struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; > + > + for (f = exp->ex_flavors; f < end; f++) { > + if (f->pseudoflavor == rqstp->rq_flavor) > + return f->flags & NFSEXP_READONLY; > + } > + return exp->ex_flags & NFSEXP_READONLY; > +} It is fortunate that this inlined monster has only one callsite. otoh, given that it has only one callsite, perhaps it should be private to fs/nfsd/vfs.c.