From nobody Thu Jan 11 14:32:36 2024 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 4T9nFK1YTHz5680D; Thu, 11 Jan 2024 14:32:37 +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 4T9nFJ6shRz4Sfl; Thu, 11 Jan 2024 14:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983557; 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=mX8VnOWwmB6fAAKpqpw7/jHNkmEP4aDLRRIWA2NharY=; b=ErA0F/ZS4CHRZ5AiSxMB0Ce/z+hpKxRv5B1bCkc3m6o+Vtbzmha4jyYlweiUvgGeYsvDZH Ulmaofm1xBaiCZQqbjXB5WC3E/uFf9lLRacnoqGfZnDPvWy2kedEFRyK5uY/xxq2KGAetD lumxpju22p2bHNwq+bNGEIQrEhDRvPDZUkz6L+lG9MzDL6PQkv68VJaoKKhaUI4yFdwIIM aNSkZ5Cjh/P3BqukvVlVDiSXYjfxKSV6y4RBEkb0KfULs3CM7uXtp90v4wRV5y83g0oEZ5 yH0yZlLk2nQZU36/Ua21YxFwCYm1BjdHgnFiXSybbEYoYqiJy/VWpCZqz8IrRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704983557; 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=mX8VnOWwmB6fAAKpqpw7/jHNkmEP4aDLRRIWA2NharY=; b=Ckteiys/dud9s4EM3sbLLxt0W44nn+ZmyHJZvlKJUhXl5ilzuyKwtkgnyWU3fkZ42vA4c8 KRUp8yD//ek9RqA2sYsmRUpGmMStNGv5VOoJXAb0cvPxCYgbum3r1ELOn+pKpljaxBYvgT N0KRE6/u7ELHe1V7MavPjbCIejPDkaw8O1aX4sNjMY4mZ3bccbOQB2DXFTXFf8BVqw/s4y VJXi0VPdqr5haOpj8dxrRtaSIY5cYebQ/Wd8PzGspYcadhiI4X9N42LtVLQOaYb09hqulg tba4uktnOgDmSb3gtG5/py87Htw2NXiYe5hIzqwcw65w4QkOD1j9BSq7qBVjfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704983557; a=rsa-sha256; cv=none; b=taa7n/KRDTm62FovVLKnXmwF6mjwMf6Vj+YtPpFOwvYWU7RPSYidrHmGEAK2pJ+tcl3X2c WAqu5LZQU1q/6e5k/aOiygF46zqX1wU53B80dN2Im/wpP/Y05bCQ3UEO6qFdv6mEOqi5uG PCwHhPtkENmsiJZCx3XTBZiMNi6/xbMbm6MGYK7Qc9eoNV9n7D5fkJQFceLqKyPHNraBnD ahTRKRLyH10IUiwVWA1LW7zByDBsO7QZWGQMboOnNPWXDT77TeqOBV3mw4sobpwFXtz9L4 dzvJCUM/MRCprzhIZBg9osakprGX9cdyYPi4lepIRrBAyiqJv+IHJisGEzwwUA== 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 4T9nFJ5zKnzMvk; Thu, 11 Jan 2024 14:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BEWaXG024256; Thu, 11 Jan 2024 14:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BEWa24024253; Thu, 11 Jan 2024 14:32:36 GMT (envelope-from git) Date: Thu, 11 Jan 2024 14:32:36 GMT Message-Id: <202401111432.40BEWa24024253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 208e68be1fae - stable/14 - vfs: Simplify vrefact() 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 208e68be1faed42ede97431476b33fc88cfd2429 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=208e68be1faed42ede97431476b33fc88cfd2429 commit 208e68be1faed42ede97431476b33fc88cfd2429 Author: Mark Johnston AuthorDate: 2024-01-04 13:11:44 +0000 Commit: Mark Johnston CommitDate: 2024-01-11 14:19:45 +0000 vfs: Simplify vrefact() refcount_acquire() returns the old value, just use that. No functional change intended. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43255 (cherry picked from commit 27f4eda3ddce4009a0ec9be68f474fe3be38933f) --- sys/kern/vfs_subr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 0fe2bc46446c..811c5cef45d1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3360,14 +3360,11 @@ vref(struct vnode *vp) void vrefact(struct vnode *vp) { + int old __diagused; CTR2(KTR_VFS, "%s: vp %p", __func__, vp); -#ifdef INVARIANTS - int old = atomic_fetchadd_int(&vp->v_usecount, 1); + old = refcount_acquire(&vp->v_usecount); VNASSERT(old > 0, vp, ("%s: wrong use count %d", __func__, old)); -#else - refcount_acquire(&vp->v_usecount); -#endif } void