From d32390eac94a7ebf99d3c2f4359f67708d25fe85 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Tue, 4 Feb 1992 07:41:22 -0800 Subject: [PATCH] together with vfs_syscalls.c add reference checking SCCS-vsn: sys/kern/vfs_subr.c 7.67.1.1 --- usr/src/sys/kern/vfs_subr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/usr/src/sys/kern/vfs_subr.c b/usr/src/sys/kern/vfs_subr.c index c52deadf26..799cc0c17c 100644 --- a/usr/src/sys/kern/vfs_subr.c +++ b/usr/src/sys/kern/vfs_subr.c @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)vfs_subr.c 7.67 (Berkeley) %G% + * @(#)vfs_subr.c 7.67.1.1 (Berkeley) %G% */ /* @@ -647,6 +647,8 @@ vget(vp) return (0); } +int bug_refs = 0; + /* * Vnode reference, just increment the count */ @@ -655,6 +657,10 @@ void vref(vp) { vp->v_usecount++; + if (vp->v_type != VBLK && curproc) + curproc->p_spare[0]++; + if (bug_refs) + vprint("vref: "); } /* @@ -681,6 +687,10 @@ void vrele(vp) panic("vrele: null vp"); #endif vp->v_usecount--; + if (vp->v_type != VBLK && curproc) + curproc->p_spare[0]--; + if (bug_refs) + vprint("vref: "); if (vp->v_usecount > 0) return; #ifdef DIAGNOSTIC -- 2.20.1