Subject: Re: Name cache question
To: None <tech-kern@NetBSD.ORG, mynhier@cs.utk.edu>
From: Wolfgang Solfrank <ws@kurt.tools.de>
List: tech-kern
Date: 07/22/1997 15:46:49
The intended semantics of this is that the filesystem lookup code calls
cache_lookup very early in its code path. During the start of this
function (in the part you cited) you may notice this:
> int
> cache_lookup(dvp, vpp, cnp)
> struct vnode *dvp;
> struct vnode **vpp;
> struct componentname *cnp;
> {
> register struct namecache *ncp;
> register struct nchashhead *ncpp;
>
> if (!doingcache) {
> cnp->cn_flags &= ~MAKEENTRY;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> return (0);
> }
> if (cnp->cn_namelen > NCHNAMLEN) {
> nchstats.ncs_long++;
> cnp->cn_flags &= ~MAKEENTRY;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> return (0);
> }
This turns off the MAKEENTRY bit in the cn_flags. This means that the caller
of cache_lookup is not meant to call cache_enter later on (this is not the
only reason that might result in MAKEENTRY being not set in cn_flags).
So this shouldn't be a problem.
For a double check however it might be appropriate to include a check for the
MAKEENTRY bit in cache_enter, at least #if DIAGNOSTIC.
Hope it helps,
Wolfgang
--
ws@TooLs.DE (Wolfgang Solfrank, TooLs GmbH) +49-228-985800