From owner-freebsd-hackers Fri Apr 25 15:29:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA16985 for hackers-outgoing; Fri, 25 Apr 1997 15:29:07 -0700 (PDT) Received: from gns.com.br (dl0235-bsb.GNS.com.br [200.239.56.235]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA16888 for ; Fri, 25 Apr 1997 15:27:41 -0700 (PDT) Received: (from dcs@localhost) by gns.com.br (8.8.5/8.7.3) id SAA04687 for hackers@hub.freebsd.org; Fri, 25 Apr 1997 18:42:25 -0300 (EST) From: "Daniel C. Sobral" Message-Id: <199704252142.SAA04687@gns.com.br> Subject: namei & hash functions In-Reply-To: <199704250932.CAA04813@hub.freebsd.org> from "owner-hackers-digest@hub.freebsd.org" at "Apr 25, 97 02:32:52 am" To: hackers@hub.freebsd.org Date: Fri, 25 Apr 1997 18:41:04 -0300 (EST) Disclaimer: Klaatu Barada Nikto! X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Index: vfs_lookup.c > =================================================================== > RCS file: /jaz/cvs/src/sys/kern/vfs_lookup.c,v > retrieving revision 1.11.4.1 > diff -r1.11.4.1 vfs_lookup.c > 271a272 > > u_long hash; > 299c300 > < cnp->cn_hash = 0; > - --- > > hash = 0; > 301c302,303 > < cnp->cn_hash += (unsigned char)*cp; > - --- > > hash = hash * 33 + (unsigned char)*cp; I think hash += hash << 5 + (unsigned char)*cp; would be better... > > cnp->cn_hash = hash; -- Daniel C. Sobral (8-DCS) dcs@gns.com.br dcs@linf.unb.br The IBM purchase of ROLM gives new meaning to the term "twisted pair". -- Howard Anderson, "Yankee Group"