Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Depending on the NAMECACHE_ENTER_REVERSE option, al...



details:   https://anonhg.NetBSD.org/src/rev/eb77919bdedf
branches:  trunk
changeset: 507704:eb77919bdedf
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Thu Mar 29 22:39:23 2001 +0000

description:
Depending on the NAMECACHE_ENTER_REVERSE option, always enter reverse
mappings (vnode -> name) in the reverse mapping hash table. Without
this option, there is no change; only directories will be entered to
speed up getcwd. This is an option because it will cause getcwd
to hit longer hash chains, and at the moment its usefulness is
still limited.

diffstat:

 sys/kern/vfs_cache.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (39 lines):

diff -r 4667f9cecc86 -r eb77919bdedf sys/kern/vfs_cache.c
--- a/sys/kern/vfs_cache.c      Thu Mar 29 21:54:01 2001 +0000
+++ b/sys/kern/vfs_cache.c      Thu Mar 29 22:39:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_cache.c,v 1.28 2000/11/24 07:25:51 chs Exp $       */
+/*     $NetBSD: vfs_cache.c,v 1.29 2001/03/29 22:39:23 fvdl Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -36,6 +36,7 @@
  */
 
 #include "opt_ddb.h"
+#include "opt_revcache.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -382,7 +383,9 @@
         */
        if (vp &&
            (vp != dvp) &&
+#ifndef NAMECACHE_ENTER_REVERSE
            (vp->v_type == VDIR) &&
+#endif
            ((ncp->nc_nlen > 2) ||
             ((ncp->nc_nlen == 2) && (ncp->nc_name[0] != '.') && (ncp->nc_name[1] != '.')) ||
             ((ncp->nc_nlen == 1) && (ncp->nc_name[0] != '.'))))
@@ -404,7 +407,11 @@
        nchashtbl =
            hashinit(desiredvnodes, HASH_LIST, M_CACHE, M_WAITOK, &nchash);
        ncvhashtbl =
+#ifdef NAMECACHE_ENTER_REVERSE
+           hashinit(desiredvnodes, HASH_LIST, M_CACHE, M_WAITOK, &ncvhash);
+#else
            hashinit(desiredvnodes/8, HASH_LIST, M_CACHE, M_WAITOK, &ncvhash);
+#endif
        pool_init(&namecache_pool, sizeof(struct namecache), 0, 0, 0,
            "ncachepl", 0, pool_page_alloc_nointr, pool_page_free_nointr,
            M_CACHE);



Home | Main Index | Thread Index | Old Index