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
This commit is contained in:
Mark Johnston 2024-01-04 08:11:44 -05:00
parent 8d01ecd8e9
commit 27f4eda3dd

View file

@ -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