vfs: add vrefactn

Differential Revision:	https://reviews.freebsd.org/D23427
This commit is contained in:
mjg 2020-02-01 06:39:49 +00:00
parent d8144f8e88
commit 2e8e2366c0
2 changed files with 14 additions and 0 deletions

View File

@ -3046,6 +3046,19 @@ vrefact(struct vnode *vp)
#endif
}
void
vrefactn(struct vnode *vp, u_int n)
{
CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
#ifdef INVARIANTS
int old = atomic_fetchadd_int(&vp->v_usecount, n);
VNASSERT(old > 0, vp, ("%s: wrong use count %d", __func__, old));
#else
atomic_add_int(&vp->v_usecount, n);
#endif
}
/*
* Return reference count of a vnode.
*

View File

@ -900,6 +900,7 @@ void vrele(struct vnode *vp);
void vref(struct vnode *vp);
void vrefl(struct vnode *vp);
void vrefact(struct vnode *vp);
void vrefactn(struct vnode *vp, u_int n);
int vrefcnt(struct vnode *vp);
void v_addpollinfo(struct vnode *vp);