Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Apr 1997 17:52:41 -0700
From:      David Greenman <dg@root.com>
To:        Don Lewis <Don.Lewis@tsc.tdk.com>
Cc:        fs@freebsd.org
Subject:   Re: the namei cache... 
Message-ID:  <199704250052.RAA12150@root.com>
In-Reply-To: Your message of "Thu, 24 Apr 1997 17:48:12 PDT." <199704250048.RAA12907@salsa.gv.tsc.tdk.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>On Apr 24,  5:44pm, David Greenman wrote:
>} Subject: Re: the namei cache...
>} >Also, the component name can be terminated with either a NUL or a /.
>} 
>}    Really? That's a surprise if true.
>
>This is right from the source:
>
>	cnp->cn_hash = 0;
>	for (cp = cnp->cn_nameptr; *cp != 0 && *cp != '/'; cp++)
>		cnp->cn_hash += (unsigned char)*cp;
>	cnp->cn_namelen = cp - cnp->cn_nameptr;
>
>It sure looks to me like it stops on '/' ;-)
>
>Also, even if you totally ditch the hash, you still need the loop
>to find the end of the component.

   Good point, although I guess you could always waste a "null" longword at
the end and trigger on that. Hmmm.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704250052.RAA12150>