git: df7ebff33c65 - stable/13 - cache: whack "set but not used" warnings

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Sat, 05 Mar 2022 19:56:53 UTC
The branch stable/13 has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=df7ebff33c654a82d8efbce52d7d66e93fd773e7

commit df7ebff33c654a82d8efbce52d7d66e93fd773e7
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-11-14 16:57:11 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-03-05 19:53:20 +0000

    cache: whack "set but not used" warnings
    
    (cherry picked from commit 7e9680d3be484baac7fe78cef2be4e7ce4b4946f)
---
 sys/kern/vfs_cache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index bc85c96c045f..ef4e33308472 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -4781,7 +4781,6 @@ cache_fplookup_emptypath(struct cache_fpl *fpl)
 	struct componentname *cnp;
 	enum vgetstate tvs;
 	struct vnode *tvp;
-	seqc_t tvp_seqc;
 	int error, lkflags;
 
 	fpl->tvp = fpl->dvp;
@@ -4790,7 +4789,6 @@ cache_fplookup_emptypath(struct cache_fpl *fpl)
 	ndp = fpl->ndp;
 	cnp = fpl->cnp;
 	tvp = fpl->tvp;
-	tvp_seqc = fpl->tvp_seqc;
 
 	MPASS(*cnp->cn_pnbuf == '\0');
 
@@ -5085,11 +5083,13 @@ cache_fplookup_dotdot(struct cache_fpl *fpl)
 static int __noinline
 cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash)
 {
-	u_char nc_flag;
+	u_char nc_flag __diagused;
 	bool neg_promote;
 
+#ifdef INVARIANTS
 	nc_flag = atomic_load_char(&ncp->nc_flag);
 	MPASS((nc_flag & NCF_NEGATIVE) != 0);
+#endif
 	/*
 	 * If they want to create an entry we need to replace this one.
 	 */