Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jul 2020 21:16:07 +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: r363198 - head/sys/kern
Message-ID:  <202007142116.06ELG7ZB022018@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Tue Jul 14 21:16:07 2020
New Revision: 363198
URL: https://svnweb.freebsd.org/changeset/base/363198

Log:
  cache: remove a useless argument from cache_negative_insert

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Tue Jul 14 21:15:16 2020	(r363197)
+++ head/sys/kern/vfs_cache.c	Tue Jul 14 21:16:07 2020	(r363198)
@@ -764,21 +764,16 @@ cache_negative_hit(struct namecache *ncp)
 }
 
 static void
-cache_negative_insert(struct namecache *ncp, bool neg_locked)
+cache_negative_insert(struct namecache *ncp)
 {
 	struct neglist *neglist;
 
 	MPASS(ncp->nc_flag & NCF_NEGATIVE);
 	cache_assert_bucket_locked(ncp, RA_WLOCKED);
 	neglist = NCP2NEGLIST(ncp);
-	if (!neg_locked) {
-		mtx_lock(&neglist->nl_lock);
-	} else {
-		mtx_assert(&neglist->nl_lock, MA_OWNED);
-	}
+	mtx_lock(&neglist->nl_lock);
 	TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst);
-	if (!neg_locked)
-		mtx_unlock(&neglist->nl_lock);
+	mtx_unlock(&neglist->nl_lock);
 	atomic_add_rel_long(&numneg, 1);
 }
 
@@ -1965,7 +1960,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
 	} else {
 		if (cnp->cn_flags & ISWHITEOUT)
 			ncp->nc_flag |= NCF_WHITE;
-		cache_negative_insert(ncp, false);
+		cache_negative_insert(ncp);
 		SDT_PROBE2(vfs, namecache, enter_negative, done, dvp,
 		    ncp->nc_name);
 	}



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