From owner-freebsd-hackers Fri Apr 25 02:32:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA04799 for hackers-outgoing; Fri, 25 Apr 1997 02:32:49 -0700 (PDT) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA04793 for ; Fri, 25 Apr 1997 02:32:47 -0700 (PDT) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.8.5/CET-v2.1) with SMTP id JAA19314; Fri, 25 Apr 1997 09:31:45 GMT Date: Fri, 25 Apr 1997 18:31:45 +0900 (JST) From: Michael Hancock To: Bakul Shah cc: FreeBSD Hackers Subject: Re: the namei cache... In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Oops, off by one when using a mask instead of a prime. It probably wouldn't have bit you anyway. On Fri, 25 Apr 1997, Michael Hancock wrote: > Index: vfs_cache.c > =================================================================== > RCS file: /jaz/cvs/src/sys/kern/vfs_cache.c,v > retrieving revision 1.20 > diff -r1.20 vfs_cache.c > 144c144 > < ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) % nchash]; > --- > > ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) & nchash]; > 249c249 > < ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) % nchash]; > --- > > ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) & nchash]; > 262c262 > < nchashtbl = phashinit(desiredvnodes, M_CACHE, &nchash); > --- > > nchashtbl = hashinit(desiredvnodes, M_CACHE, &nchash); Index: vfs_cache.c =================================================================== RCS file: /jaz/cvs/src/sys/kern/vfs_cache.c,v retrieving revision 1.20 diff -r1.20 vfs_cache.c 144c144 < ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) % nchash]; --- > ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) & nchash]; 249c249 < ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) % nchash]; --- > ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) & nchash]; 262c262 < nchashtbl = phashinit(desiredvnodes, M_CACHE, &nchash); --- > nchashtbl = hashinit(desiredvnodes, M_CACHE, &nchash); 286c286 < for (ncpp = &nchashtbl[nchash - 1]; ncpp >= nchashtbl; ncpp--) { --- > for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl; ncpp--) { 312c312 < for (ncpp = &nchashtbl[nchash - 1]; ncpp >= nchashtbl; ncpp--) { --- > for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl; ncpp--) {