Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261743AbTENJl6 (ORCPT ); Wed, 14 May 2003 05:41:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261789AbTENJl6 (ORCPT ); Wed, 14 May 2003 05:41:58 -0400 Received: from pub237.cambridge.redhat.com ([213.86.99.237]:10736 "EHLO warthog.warthog") by vger.kernel.org with ESMTP id S261743AbTENJlz (ORCPT ); Wed, 14 May 2003 05:41:55 -0400 To: Muli Ben-Yehuda cc: David Howells , Linux-Kernel Subject: Re: [PATCH] PAG support only In-Reply-To: <20030514045744.GQ11374@actcom.co.il> User-Agent: EMH/1.14.1 SEMI/1.14.4 (Hosorogi) FLIM/1.14.4 (=?ISO-8859-4?Q?Kashiharajing=FE-mae?=) APEL/10.4 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Date: Wed, 14 May 2003 10:54:36 +0100 Message-ID: <19000.1052906076@warthog.warthog> From: David Howells Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1807 Lines: 56 Muli Ben-Yehuda wrote: > > + * VFS session authentication token cache > ... > > If you know the type of the data, why keep it all in one binary blob, > instead of a struct? cache effects? No. We _don't_ know the type of the data. A filesystem entrusts us with a token to keep in the PAG on its behalf. However, since this is meant to be a generic mechanism, it's entirely dependent on the fs as to what's in the blob. > > + if (tsk->vfspag->pag && > > Isn't the check here meant to be against tsk->vfspag? If not, there > should be. Good point. Fixed. > If vfs_pag_next wraps around, you will get two pag's with the value > '1'. Not so: + else + goto pag_exists; + } + goto insert_here; + + /* we found a PAG of the same ID - walk the tree from that point + * looking for the next unused PAG */ + pag_exists: If we find the target PAG already present, we keep incrementing the counter (making sure it doesn't go -ve or 0) and searching from the current node in the tree until we find a gap in the currently instantiated PAG number space. We can make use of the properties of rb trees to do this more efficiently than just incrementing and repeating the search every time. rb_next() will return the node with next highest instantiated PAG number (or NULL when it reaches the end of the tree). > Nothing in this patch appears to be using it. You aren't taking a > reference to the token here, what's protecting it from disappearing > after the return and before the caller gets a chance to do something > with it? Thanks. Fixed. David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/