Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Nov 2019 01:20:21 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355123 - head/sys/kern
Message-ID:  <201911270120.xAR1KL2C030247@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Wed Nov 27 01:20:21 2019
New Revision: 355123
URL: https://svnweb.freebsd.org/changeset/base/355123

Log:
  cache: hide "doingcache" behind DEBUG_CACHE

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Wed Nov 27 00:39:23 2019	(r355122)
+++ head/sys/kern/vfs_cache.c	Wed Nov 27 01:20:21 2019	(r355123)
@@ -330,9 +330,11 @@ cache_out_ts(struct namecache *ncp, struct timespec *t
 		*ticksp = ncp_ts->nc_ticks;
 }
 
+#ifdef DEBUG_CACHE
 static int __read_mostly	doingcache = 1;	/* 1 => enable the cache */
 SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0,
     "VFS namecache enabled");
+#endif
 
 /* Export size information to userland */
 SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, SYSCTL_NULL_INT_PTR,
@@ -1298,10 +1300,12 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st
 	enum vgetstate vs;
 	int error, ltype;
 
+#ifdef DEBUG_CACHE
 	if (__predict_false(!doingcache)) {
 		cnp->cn_flags &= ~MAKEENTRY;
 		return (0);
 	}
+#endif
 
 	counter_u64_add(numcalls, 1);
 
@@ -1681,8 +1685,10 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
 	VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp,
 	    ("cache_enter: Doomed vnode used as src"));
 
+#ifdef DEBUG_CACHE
 	if (__predict_false(!doingcache))
 		return;
+#endif
 
 	/*
 	 * Avoid blowout in namecache entries.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911270120.xAR1KL2C030247>