summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-07-30 09:57:37 +0000
committerjeff <jeff@FreeBSD.org>2002-07-30 09:57:37 +0000
commitb1cd18ff699cd07fc243c1fe1439a3ab978e622a (patch)
treebc5bd13ba9585ba2f44f33de2f7ee470f6f497b0
parent0dff235badb0fdb473791bcee6a9b94e73fa7350 (diff)
downloadFreeBSD-src-b1cd18ff699cd07fc243c1fe1439a3ab978e622a.zip
FreeBSD-src-b1cd18ff699cd07fc243c1fe1439a3ab978e622a.tar.gz
- Add vfs_badlock_{print,panic} support to the remaining VOP_ASSERT_*
macros.
-rw-r--r--sys/sys/vnode.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 15f4bfb..ddcae41 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);
OpenPOWER on IntegriCloud