diff options
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 0b73d14d77ac..be6163c55a4b 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2645,7 +2645,7 @@ vputx(struct vnode *vp, int func) error = 0; if (vp->v_usecount != 0) { - vprint("vputx: usecount not zero", vp); + vn_printf(vp, "vputx: usecount not zero for vnode "); panic("vputx: usecount not zero"); } @@ -3036,7 +3036,7 @@ loop: busy++; #ifdef DIAGNOSTIC if (busyprt) - vprint("vflush: busy vnode", vp); + vn_printf(vp, "vflush: busy vnode "); #endif } VOP_UNLOCK(vp, 0); @@ -3409,7 +3409,7 @@ DB_SHOW_COMMAND(lockedvnods, lockedvnodes) TAILQ_FOREACH(mp, &mountlist, mnt_list) { TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { if (vp->v_type != VMARKER && VOP_ISLOCKED(vp)) - vprint("", vp); + vn_printf(vp, "vnode "); } } } @@ -4402,6 +4402,10 @@ int vfs_badlock_print = 1; /* Print lock violations. */ SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_print, CTLFLAG_RW, &vfs_badlock_print, 0, "Print lock violations"); +int vfs_badlock_vnode = 1; /* Print vnode details on lock violations. */ +SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_vnode, CTLFLAG_RW, &vfs_badlock_vnode, + 0, "Print vnode details on lock violations"); + #ifdef KDB int vfs_badlock_backtrace = 1; /* Print backtrace at lock violations. */ SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_backtrace, CTLFLAG_RW, @@ -4416,6 +4420,8 @@ vfs_badlock(const char *msg, const char *str, struct vnode *vp) if (vfs_badlock_backtrace) kdb_backtrace(); #endif + if (vfs_badlock_vnode) + vn_printf(vp, "vnode "); if (vfs_badlock_print) printf("%s: %p %s\n", str, (void *)vp, msg); if (vfs_badlock_ddb) @@ -4465,25 +4471,6 @@ assert_vop_elocked(struct vnode *vp, const char *str) if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vfs_badlock("is not exclusive locked but should be", str, vp); } - -#if 0 -void -assert_vop_elocked_other(struct vnode *vp, const char *str) -{ - - if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) != LK_EXCLOTHER) - vfs_badlock("is not exclusive locked by another thread", - str, vp); -} - -void -assert_vop_slocked(struct vnode *vp, const char *str) -{ - - if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) != LK_SHARED) - vfs_badlock("is not locked shared but should be", str, vp); -} -#endif /* 0 */ #endif /* DEBUG_VFS_LOCKS */ void |