summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1999-01-20 14:49:12 +0000
committereivind <eivind@FreeBSD.org>1999-01-20 14:49:12 +0000
commit836035a4edf2d12174893117e0db29e309203a8b (patch)
treeb49b8271eedf41e5c0a341956ab5c43489f98b71 /sys/kern/vfs_vnops.c
parentaf1ac09a53e9b9f7d330522b7109c3ae65dbba61 (diff)
downloadFreeBSD-src-836035a4edf2d12174893117e0db29e309203a8b.zip
FreeBSD-src-836035a4edf2d12174893117e0db29e309203a8b.tar.gz
Add 'options DEBUG_LOCKS', which stores extra information in struct
lock, and add some macros and function parameters to make sure that the information get to the point where it can be put in the lock structure. While I'm here, add DEBUG_VFS_LOCKS to LINT.
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 756c945..0b32a7d 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
- * $Id: vfs_vnops.c,v 1.60 1998/11/02 02:36:16 peter Exp $
+ * $Id: vfs_vnops.c,v 1.61 1999/01/05 18:49:56 eivind Exp $
*/
#include <sys/param.h>
@@ -510,10 +510,18 @@ vn_poll(fp, events, cred, p)
* acquire requested lock.
*/
int
+#ifndef DEBUG_LOCKS
vn_lock(vp, flags, p)
+#else
+debug_vn_lock(vp, flags, p, filename, line)
+#endif
struct vnode *vp;
int flags;
struct proc *p;
+#ifdef DEBUG_LOCKS
+ const char *filename;
+ int line;
+#endif
{
int error;
@@ -526,7 +534,12 @@ vn_lock(vp, flags, p)
tsleep((caddr_t)vp, PINOD, "vn_lock", 0);
error = ENOENT;
} else {
- error = VOP_LOCK(vp, flags | LK_NOPAUSE | LK_INTERLOCK, p);
+#ifdef DEBUG_LOCKS
+ vp->filename = filename;
+ vp->line = line;
+#endif
+ error = VOP_LOCK(vp,
+ flags | LK_NOPAUSE | LK_INTERLOCK, p);
if (error == 0)
return (error);
}
OpenPOWER on IntegriCloud