Subject: Re: vfs namecache change
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Antti Kantee <pooka@cs.hut.fi>
List: tech-kern
Date: 01/07/2007 22:44:55
On Sat Dec 30 2006 at 08:52:58 +0900, YAMAMOTO Takashi wrote:
> > Index: vfs_lookup.c
> > ===================================================================
> > RCS file: /cvsroot/src/sys/kern/vfs_lookup.c,v
> > retrieving revision 1.77
> > diff -u -r1.77 vfs_lookup.c
> > --- vfs_lookup.c	27 Dec 2006 23:21:02 -0000	1.77
> > +++ vfs_lookup.c	29 Dec 2006 19:02:46 -0000
> > @@ -527,7 +527,7 @@
> >  	 * Setup: break out flag bits into variables.
> >  	 */
> >  	docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE;
> > -	if (cnp->cn_nameiop != CREATE)
> > +	if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_nameiop != CREATE))
> >  		docache = 0;
> 
> i prefer:
> 
> 	if (cnp->cn_nameiop == DELETE)
> 		docache = 0;

Yes, that's more sensible.  But why do we have both NOCACHE and the
check here?  Seems like we could do DELETE || RENAME here and get rid
of NOCACHE in the rename namei() calls, for consistency.

I committed the above, we can tweak it more later.  thanks

-- 
Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"