summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 6c231f4..924fa18 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cache.c 8.3 (Berkeley) 8/22/94
- * $Id: vfs_cache.c,v 1.18 1995/12/14 09:52:47 phk Exp $
+ * $Id: vfs_cache.c,v 1.19 1995/12/22 15:56:35 phk Exp $
*/
#include <sys/param.h>
@@ -47,6 +47,8 @@
#include <sys/errno.h>
#include <sys/malloc.h>
+#define MAXVNODEUSE 32
+
/*
* Name caching works as follows:
*
@@ -173,6 +175,8 @@ cache_lookup(dvp, vpp, cnp)
nchstats.ncs_goodhits++;
TOUCH(ncp);
*vpp = ncp->nc_vp;
+ if ((*vpp)->v_usage < MAXVNODEUSE)
+ (*vpp)->v_usage++;
return (-1);
}
@@ -234,6 +238,8 @@ cache_enter(dvp, vp, cnp)
/* fill in cache info */
ncp->nc_vp = vp;
+ if (vp->v_usage < MAXVNODEUSE)
+ ++vp->v_usage;
ncp->nc_vpid = vp->v_id;
ncp->nc_dvp = dvp;
ncp->nc_dvpid = dvp->v_id;
OpenPOWER on IntegriCloud