summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-05-30 05:55:22 +0000
committerjeff <jeff@FreeBSD.org>2002-05-30 05:55:22 +0000
commitfeec324370619aa6315e4a5fdeecfe83518d43e5 (patch)
tree4a89c6cc6a6e5f1a48a0bacf9e95d8bf8ed9853d /sys/kern/kern_lock.c
parentaa9fde6b9153de1fbf0c6a327ba8af924e1e11f5 (diff)
downloadFreeBSD-src-feec324370619aa6315e4a5fdeecfe83518d43e5.zip
FreeBSD-src-feec324370619aa6315e4a5fdeecfe83518d43e5.tar.gz
Record the file, line, and pid of the last successful shared lock holder. This
is useful as a last effort in debugging file system deadlocks. This is enabled via 'options DEBUG_LOCKS'
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index fddfd26..5189bb7 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -259,6 +259,12 @@ debuglockmgr(lkp, flags, interlkp, td, name, file, line)
if (error)
break;
sharelock(lkp, 1);
+#if defined(DEBUG_LOCKS)
+ lkp->lk_slockholder = pid;
+ lkp->lk_sfilename = file;
+ lkp->lk_slineno = line;
+ lkp->lk_slockername = name;
+#endif
break;
}
/*
OpenPOWER on IntegriCloud