From nobody Mon Oct 24 15:40:26 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MwzmW0YC5z4g1Fg; Mon, 24 Oct 2022 15:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MwzmV6hFwz3VVL; Mon, 24 Oct 2022 15:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666626026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBzIJhiTiEqQmlV9tigK2PPw+8QnbVDWeIIV88WB6YI=; b=nEjnNGFqRg2peqvj6+9+Io627k9rYyXiFlZmIzRQneGTjwx/9cyB/DE+Om0Yz3N1SxIubu uCPd2Tgeh1637IMM2RIcLrycQ9fDvEJqqliZHYoU01V7oIZ2nqVGW57CVYYhlBVNCGCAvk r3wuLvHot/Hg9dTi0C9OEN8vGrewBpLp3nSmxB/z5aug2gkdJ/Onnmbm4rp+iCOApsOfZe jJVXn0beJEqh6Klw/BFzidmmfD/vg6qqFKNgXkBBp5eYM65yRbCaTqoPJ2xv0wbvZeN6ol o++rRuUXqfJdiEwNOAB94FTDmea1MysYVn7/+LLrUBEkZo15wspygNOvjYpehA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MwzmV5VC8zH7n; Mon, 24 Oct 2022 15:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29OFeQeo096594; Mon, 24 Oct 2022 15:40:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29OFeQRD096593; Mon, 24 Oct 2022 15:40:26 GMT (envelope-from git) Date: Mon, 24 Oct 2022 15:40:26 GMT Message-Id: <202210241540.29OFeQRD096593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: d653aaec7a31 - main - cache: add cache_assert_no_entries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d653aaec7a311a7d1455e9721904b2a341b32a65 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666626026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBzIJhiTiEqQmlV9tigK2PPw+8QnbVDWeIIV88WB6YI=; b=r9zYmYlr3ECayOoALNjVa36ZyjHaapKQvzXHaiB6gDXb8AIA1fxUt88CbIlHeNsYMKbIap ZGtcfT6tlaVeUwmSvapCgieqV0d+BKdpFRcuQXruzFkawqWFKSoyFvXR802Zz64RRUCJEM CEaERPhfdo3eut7tXxruoRjCnbbz9PDN46p1u4dDbXlVzYqHnl3+QLv2HSBBztRP6/2ENj RIY8DaHhKTRMKmeRMMlEy3E9eOnO17+CKJMJel6b4D6UCDVVXs2eTMEWQfnHqaGMkHfPr1 wKv9rD197qKeOyZjsoSY+CUPlCb2u/AT0Zqhu7CtgK3uD61/yf5OlN2n/BuH4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666626026; a=rsa-sha256; cv=none; b=PJaljMult2vURuVZZlDiQEdvnWW4U3plaHvYUwsSP7DodAg9BHc3Ti6NnEk2zMo+j69AbN yoS3VtwYbX+a75PCmHAkx73nfhBz5xZuCi3R6aQj7d7ig/UKd12QzSncAOtHXtpB1UaC/m +6oaZV39FznY+pGfcwLs+7pRZQHu6KNZBRAyMDZvWuuOZfIRJvNxOeip12N/H2Hux0MDvY pEJOUqdvxsoTEj+MXsCfKH27ZrkDWSqBak+AG2a0+5QW3lAfdRJDuy+JBWq0OkWr+EwvTW 2uYppKQCo1wJirhTFqTR1aELh6eFmEUnpGBkfuS4LbYulyEMieJ3MyoCFSe/Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d653aaec7a311a7d1455e9721904b2a341b32a65 commit d653aaec7a311a7d1455e9721904b2a341b32a65 Author: Mateusz Guzik AuthorDate: 2022-10-24 15:34:57 +0000 Commit: Mateusz Guzik CommitDate: 2022-10-24 15:37:43 +0000 cache: add cache_assert_no_entries --- sys/kern/vfs_cache.c | 9 +++++++++ sys/sys/vnode.h | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 5f72506549bd..e58d3f338085 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2998,6 +2998,15 @@ cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) } mtx_unlock(blp); } + +void +cache_assert_no_entries(struct vnode *vp) +{ + + VNPASS(TAILQ_EMPTY(&vp->v_cache_dst), vp); + VNPASS(LIST_EMPTY(&vp->v_cache_src), vp); + VNPASS(vp->v_cache_dd == NULL, vp); +} #endif /* diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 63b3c23bd072..167f1904b70d 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -676,11 +676,17 @@ void cache_vop_rmdir(struct vnode *dvp, struct vnode *vp); #ifdef INVARIANTS void cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp); +void cache_assert_no_entries(struct vnode *vp); #else static inline void cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) { } + +static inline void +cache_assert_no_entries(struct vnode *vp) +{ +} #endif void cache_fast_lookup_enabled_recalc(void); int change_dir(struct vnode *vp, struct thread *td);