From owner-freebsd-fs Thu Apr 24 17:51:13 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA13567 for fs-outgoing; Thu, 24 Apr 1997 17:51:13 -0700 (PDT) Received: from root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA13555 for ; Thu, 24 Apr 1997 17:51:10 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by root.com (8.8.5/8.6.5) with SMTP id RAA12150; Thu, 24 Apr 1997 17:52:41 -0700 (PDT) Message-Id: <199704250052.RAA12150@root.com> X-Authentication-Warning: implode.root.com: localhost [127.0.0.1] didn't use HELO protocol To: Don Lewis cc: fs@freebsd.org Subject: Re: the namei cache... In-reply-to: Your message of "Thu, 24 Apr 1997 17:48:12 PDT." <199704250048.RAA12907@salsa.gv.tsc.tdk.com> From: David Greenman Reply-To: dg@root.com Date: Thu, 24 Apr 1997 17:52:41 -0700 Sender: owner-fs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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