mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
vfs: patch up vnode count assertions to report found value
This commit is contained in:
parent
1cde9e385a
commit
867fd730c6
1 changed files with 6 additions and 6 deletions
|
|
@ -2846,8 +2846,8 @@ vget_finish(struct vnode *vp, int flags, enum vgetstate vs)
|
|||
*/
|
||||
if (refcount_acquire_if_not_zero(&vp->v_usecount)) {
|
||||
#ifdef INVARIANTS
|
||||
int old = atomic_fetchadd_int(&vp->v_holdcnt, -1) - 1;
|
||||
VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__));
|
||||
int old = atomic_fetchadd_int(&vp->v_holdcnt, -1);
|
||||
VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old));
|
||||
#else
|
||||
refcount_release(&vp->v_holdcnt);
|
||||
#endif
|
||||
|
|
@ -2872,8 +2872,8 @@ vget_finish(struct vnode *vp, int flags, enum vgetstate vs)
|
|||
*/
|
||||
if (refcount_acquire_if_not_zero(&vp->v_usecount)) {
|
||||
#ifdef INVARIANTS
|
||||
int old = atomic_fetchadd_int(&vp->v_holdcnt, -1) - 1;
|
||||
VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__));
|
||||
int old = atomic_fetchadd_int(&vp->v_holdcnt, -1);
|
||||
VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old));
|
||||
#else
|
||||
refcount_release(&vp->v_holdcnt);
|
||||
#endif
|
||||
|
|
@ -2953,7 +2953,7 @@ vrefact(struct vnode *vp)
|
|||
CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
|
||||
#ifdef INVARIANTS
|
||||
int old = atomic_fetchadd_int(&vp->v_usecount, 1);
|
||||
VNASSERT(old > 0, vp, ("%s: wrong use count", __func__));
|
||||
VNASSERT(old > 0, vp, ("%s: wrong use count %d", __func__, old));
|
||||
#else
|
||||
refcount_acquire(&vp->v_usecount);
|
||||
#endif
|
||||
|
|
@ -3189,7 +3189,7 @@ vholdnz(struct vnode *vp)
|
|||
CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
|
||||
#ifdef INVARIANTS
|
||||
int old = atomic_fetchadd_int(&vp->v_holdcnt, 1);
|
||||
VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__));
|
||||
VNASSERT(old > 0, vp, ("%s: wrong hold count %d", __func__, old));
|
||||
#else
|
||||
atomic_add_int(&vp->v_holdcnt, 1);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue