diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2002-07-30 09:57:37 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2002-07-30 09:57:37 +0000 |
commit | c72f085d048a1ab581851300c8ece724a38a5452 (patch) | |
tree | bc5bd13ba9585ba2f44f33de2f7ee470f6f497b0 /sys/sys/vnode.h | |
parent | cf409a0a984ab591f04bbc47b3af1245ba9a130d (diff) | |
download | src-c72f085d048a1ab581851300c8ece724a38a5452.tar.gz src-c72f085d048a1ab581851300c8ece724a38a5452.zip |
- Add vfs_badlock_{print,panic} support to the remaining VOP_ASSERT_*
macros.
Notes
Notes:
svn path=/head/; revision=100920
Diffstat (limited to 'sys/sys/vnode.h')
-rw-r--r-- | sys/sys/vnode.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 15f4bfb58b05..ddcae4199161 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -501,9 +501,13 @@ do { \ struct vnode *_vp = (vp); \ \ if (_vp && !IGNORE_LOCK(_vp) && \ - VOP_ISLOCKED(_vp, curthread) != LK_EXCLUSIVE) \ - panic("%s: %p is not exclusive locked but should be", \ - str, _vp); \ + VOP_ISLOCKED(_vp, curthread) != LK_EXCLUSIVE) { \ + if (vfs_badlock_print) \ + printf("%s: %p is not exclusive locked but should be\n",\ + str, _vp); \ + if (vfs_badlock_panic) \ + Debugger("Lock violation.\n"); \ + } \ } while (0) #define ASSERT_VOP_ELOCKED_OTHER(vp, str) \ @@ -511,9 +515,13 @@ do { \ struct vnode *_vp = (vp); \ \ if (_vp && !IGNORE_LOCK(_vp) && \ - VOP_ISLOCKED(_vp, curthread) != LK_EXCLOTHER) \ - panic("%s: %p is not exclusive locked by another thread", \ - str, _vp); \ + VOP_ISLOCKED(_vp, curthread) != LK_EXCLOTHER) { \ + if (vfs_badlock_print) \ + printf("%s: %p is not exclusive locked by another thread\n",\ + str, _vp); \ + if (vfs_badlock_panic) \ + Debugger("Lock violation.\n"); \ + } \ } while (0) #define ASSERT_VOP_SLOCKED(vp, str) \ @@ -521,9 +529,13 @@ do { \ struct vnode *_vp = (vp); \ \ if (_vp && !IGNORE_LOCK(_vp) && \ - VOP_ISLOCKED(_vp, NULL) != LK_SHARED) \ - panic("%s: %p is not locked shared but should be", \ + VOP_ISLOCKED(_vp, NULL) != LK_SHARED) { \ + if (vfs_badlock_print) \ + printf("%s: %p is not locked shared but should be",\ str, _vp); \ + if (vfs_badlock_panic) \ + Debugger("Lock violation.\n"); \ + } \ } while (0) void vop_rename_pre(void *a); |