From nobody Thu Jan 04 13:40:15 2024 X-Original-To: dev-commits-src-main@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 4T5SQ73yChz56Q9B; Thu, 4 Jan 2024 13:40:15 +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 4T5SQ73Vvvz41R9; Thu, 4 Jan 2024 13:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704375615; 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=j+Q56XUNKC0HpZZrKq+qONXp9OgABfynGzvfe8DmyUU=; b=RYRQVKHDFgOSG8u9N+uA1yWTAr7jruthERtxZ4oeytukXaFCb0sBn58T7UqrMd05t3fs0w 8KnjMNltd/dfBA5tKHNDaC967fv7WaEN6V5NNYlru+vD0E0KSKPRDARe8dpmo7sL4MJXcj uBtz9r+Y5dUy03tjuGu7EwiLGaa/kz3WO6NQm/F+qbM5H/1lO9sENGYrEEYauYQ0wN9AE3 rJ/ND8BCpatHGFHFJ/KiZoQJnTl11WTwaGKx/cn7au5q95zQNHDeC//gSC47aHp7e4H54E telPY8zbG41UGIZt6FNfbbcHHT5cU3GWaotAFMMmf5WbK+I5NucfpPVRHH2mjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704375615; 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=j+Q56XUNKC0HpZZrKq+qONXp9OgABfynGzvfe8DmyUU=; b=LFSZvuSCu35Q6dIoFsjm/Bc0jry1eNUCc+XAuZZr3F55IsLXomCHY/t3f0OXhfIWJcecMa b7XaTy+BpNB8OH+lJI+JhjWyln/Rs6Eiwi9Q6pDRDCryLjJvryC/UBN42U4ZMKJtGBp9+7 289MDRRMpaK9Rs+VDk/+mMy0g3Q2TpROrov+DPPZSq07A6bUAmHqM+3dDuawBbsjTDqcDW 0MJJP86ZSkWqSJ0p8jIM9vWBTPT/u09jLEv0NSYbbZGn/jvoMo6KaTBIoYpMaDUMnl2BOX KPXEn29Y4Nj90PVmS/CDvJk4IWM0MwfkRecGEQuBMd5uJndR4aTVRrqB7Y6geA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704375615; a=rsa-sha256; cv=none; b=q4EWiNI0rOSN2rl/5UgVB3uA+ZqpugTWSPNvVQqassJeGSltpOReVcVkmXENq4WSIMYTZn rge9C2x9tc5Qhn7pJDVSevAnAXSDKcDogshNLzcSdGD5InGEUIseO03SVx0lfUC4cRxkH2 tt/e2Lf2BAfLGynukpewZzU/kCb5yLi6MyDvfabrEekJn8Dxw/EXBFFoN6mq8cEyoxuGC+ UuMfcE8kxhJYP2jb+0YYdNlg1PSvSaTVlNg3vAJaYuIjKcvhbolQ2JosnX0IkWWXABgvRG 07S59N7z4C+FaiUxbVUQP7qjq2ytd32aLibrbwUkOAz11FOo/vVde5to53TaBg== 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 4T5SQ72cv6zFqP; Thu, 4 Jan 2024 13:40:15 +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 404DeFcW040219; Thu, 4 Jan 2024 13:40:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 404DeFDR040211; Thu, 4 Jan 2024 13:40:15 GMT (envelope-from git) Date: Thu, 4 Jan 2024 13:40:15 GMT Message-Id: <202401041340.404DeFDR040211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 27f4eda3ddce - main - vfs: Simplify vrefact() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 27f4eda3ddce4009a0ec9be68f474fe3be38933f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=27f4eda3ddce4009a0ec9be68f474fe3be38933f commit 27f4eda3ddce4009a0ec9be68f474fe3be38933f Author: Mark Johnston AuthorDate: 2024-01-04 13:11:44 +0000 Commit: Mark Johnston CommitDate: 2024-01-04 13:39:52 +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 --- 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 d2a245081f3d..eb82f2d86aff 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3345,14 +3345,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