summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-11-13 05:51:22 +0000
committerkmacy <kmacy@FreeBSD.org>2006-11-13 05:51:22 +0000
commit0c00ea16dbadcde1937dfc2bef577820b762e95a (patch)
treec2c7577af1d9350da736e5ba02f23f6df8c9f273 /sys/kern
parentc07fe38e024b8eb9ed43c77f898e85cf8c488928 (diff)
downloadFreeBSD-src-0c00ea16dbadcde1937dfc2bef577820b762e95a.zip
FreeBSD-src-0c00ea16dbadcde1937dfc2bef577820b762e95a.tar.gz
change vop_lock handling to allowing tracking of callers' file and line for
acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_default.c8
-rw-r--r--sys/kern/vfs_subr.c6
-rw-r--r--sys/kern/vfs_vnops.c7
-rw-r--r--sys/kern/vnode_if.src4
4 files changed, 13 insertions, 12 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index 0232ff3..38f0e47 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -86,7 +86,7 @@ struct vop_vector default_vnodeops = {
.vop_kqfilter = vop_stdkqfilter,
.vop_islocked = vop_stdislocked,
.vop_lease = VOP_NULL,
- .vop_lock = vop_stdlock,
+ ._vop_lock = vop_stdlock,
.vop_lookup = vop_nolookup,
.vop_open = VOP_NULL,
.vop_pathconf = VOP_EINVAL,
@@ -252,15 +252,17 @@ vop_stdpathconf(ap)
*/
int
vop_stdlock(ap)
- struct vop_lock_args /* {
+ struct _vop_lock_args /* {
struct vnode *a_vp;
int a_flags;
struct thread *a_td;
+ char *file;
+ int line;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
- return (lockmgr(vp->v_vnlock, ap->a_flags, VI_MTX(vp), ap->a_td));
+ return (_lockmgr(vp->v_vnlock, ap->a_flags, VI_MTX(vp), ap->a_td, ap->a_file, ap->a_line));
}
/* See above. */
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index b9a65da..e860b1b 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2994,7 +2994,7 @@ static struct vop_vector sync_vnodeops = {
.vop_fsync = sync_fsync, /* fsync */
.vop_inactive = sync_inactive, /* inactive */
.vop_reclaim = sync_reclaim, /* reclaim */
- .vop_lock = vop_stdlock, /* lock */
+ ._vop_lock = vop_stdlock, /* lock */
.vop_unlock = vop_stdunlock, /* unlock */
.vop_islocked = vop_stdislocked, /* islocked */
};
@@ -3498,7 +3498,7 @@ void
vop_lock_pre(void *ap)
{
#ifdef DEBUG_VFS_LOCKS
- struct vop_lock_args *a = ap;
+ struct _vop_lock_args *a = ap;
if ((a->a_flags & LK_INTERLOCK) == 0)
ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK");
@@ -3511,7 +3511,7 @@ void
vop_lock_post(void *ap, int rc)
{
#ifdef DEBUG_VFS_LOCKS
- struct vop_lock_args *a = ap;
+ struct _vop_lock_args *a = ap;
ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK");
if (rc == 0)
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 3511044..c56d7fc 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -799,10 +799,7 @@ vn_poll(fp, events, active_cred, td)
* acquire requested lock.
*/
int
-vn_lock(vp, flags, td)
- struct vnode *vp;
- int flags;
- struct thread *td;
+_vn_lock(struct vnode *vp, int flags, struct thread *td, char *file, int line)
{
int error;
@@ -825,7 +822,7 @@ vn_lock(vp, flags, td)
* lockmgr drops interlock before it will return for
* any reason. So force the code above to relock it.
*/
- error = VOP_LOCK(vp, flags | LK_INTERLOCK, td);
+ error = _VOP_LOCK(vp, flags | LK_INTERLOCK, td, file, line);
flags &= ~LK_INTERLOCK;
KASSERT((flags & LK_RETRY) == 0 || error == 0,
("LK_RETRY set with incompatible flags %d\n", flags));
diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src
index 5b2c4cb..e3b338b 100644
--- a/sys/kern/vnode_if.src
+++ b/sys/kern/vnode_if.src
@@ -365,10 +365,12 @@ vop_reclaim {
%! lock pre vop_lock_pre
%! lock post vop_lock_post
-vop_lock {
+_vop_lock {
IN struct vnode *vp;
IN int flags;
IN struct thread *td;
+ IN char *file;
+ IN int line;
};
OpenPOWER on IntegriCloud