mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 08:12:27 -04:00
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:
parent
8d01ecd8e9
commit
27f4eda3dd
1 changed files with 2 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue