Subject: Re: ufs-ism in lookup(9)
To: None <wrstuden@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 04/06/2004 19:39:41
hi,

> I think the reason for doing the removal is that you simplify the cache
> logic.

actually, its side effects increases complexity, IMO.

> You don't need to remember to remove the negative entry before 
> creating the positive one, and if the opertation fails such that you know 
> you have no such file, you can (if you wish) freely create a new negative 
> entry.

i think it's better to allow cache_enter() to overwrite an existing entry.

> And, I think, the changes I posted only do the removal for the 
> CREATE case, not the DELETE case. I decided to let the fs deal with that 
> case. :-)

why do you always want to do the automatic removal for CREATE case?
consider O_EXCL create on nfsv2.
if you already have a negative cache entry,
i guess you don't want to issue a remote call to recheck it.
(or, at least, want to let the filesystem implementation make
its decision about usefulness of the cache.)
because current cache_lookup() silently removes the entry,
you have no clean way to see the negative entry.

YAMAMOTO Takashi