summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_default.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-09-25 01:42:24 +0000
committerjeff <jeff@FreeBSD.org>2002-09-25 01:42:24 +0000
commit0649189fd776d36c74129a97fa91f70bd08dde64 (patch)
tree04d81866511d32d38ea1fcf4099991bd04edbfc6 /sys/kern/vfs_default.c
parent9e67fe9c96d63ef3ff72da83f7321d19c6d6f9b4 (diff)
downloadFreeBSD-src-0649189fd776d36c74129a97fa91f70bd08dde64.zip
FreeBSD-src-0649189fd776d36c74129a97fa91f70bd08dde64.tar.gz
- Use the standard vp interlock macros.
Diffstat (limited to 'sys/kern/vfs_default.c')
-rw-r--r--sys/kern/vfs_default.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index 81c2167..e179b55 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -276,9 +276,9 @@ vop_stdlock(ap)
struct vnode *vp = ap->a_vp;
#ifndef DEBUG_LOCKS
- return (lockmgr(&vp->v_lock, ap->a_flags, &vp->v_interlock, ap->a_td));
+ return (lockmgr(&vp->v_lock, ap->a_flags, VI_MTX(vp), ap->a_td));
#else
- return (debuglockmgr(&vp->v_lock, ap->a_flags, &vp->v_interlock,
+ return (debuglockmgr(&vp->v_lock, ap->a_flags, VI_MTX(vp),
ap->a_td, "vop_stdlock", vp->filename, vp->line));
#endif
}
@@ -294,7 +294,7 @@ vop_stdunlock(ap)
{
struct vnode *vp = ap->a_vp;
- return (lockmgr(&vp->v_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock,
+ return (lockmgr(&vp->v_lock, ap->a_flags | LK_RELEASE, VI_MTX(vp),
ap->a_td));
}
@@ -423,9 +423,9 @@ vop_sharedlock(ap)
if (flags & LK_INTERLOCK)
vnflags |= LK_INTERLOCK;
#ifndef DEBUG_LOCKS
- return (lockmgr(&vp->v_lock, vnflags, &vp->v_interlock, ap->a_td));
+ return (lockmgr(&vp->v_lock, vnflags, VI_MTX(vp), ap->a_td));
#else
- return (debuglockmgr(&vp->v_lock, vnflags, &vp->v_interlock, ap->a_td,
+ return (debuglockmgr(&vp->v_lock, vnflags, VI_MTX(vp), ap->a_td,
"vop_sharedlock", vp->filename, vp->line));
#endif
}
@@ -480,14 +480,14 @@ vop_nolock(ap)
}
if (flags & LK_INTERLOCK)
vnflags |= LK_INTERLOCK;
- return(lockmgr(&vp->v_lock, vnflags, &vp->v_interlock, ap->a_td));
+ return(lockmgr(&vp->v_lock, vnflags, VI_MTX(vp), ap->a_td));
#else /* for now */
/*
* Since we are not using the lock manager, we must clear
* the interlock here.
*/
if (ap->a_flags & LK_INTERLOCK)
- mtx_unlock(&ap->a_vp->v_interlock);
+ VI_UNLOCK(ap->a_vp);
return (0);
#endif
}
@@ -509,7 +509,7 @@ vop_nounlock(ap)
* the interlock here.
*/
if (ap->a_flags & LK_INTERLOCK)
- mtx_unlock(&ap->a_vp->v_interlock);
+ VI_UNLOCK(ap->a_vp);
return (0);
}
@@ -582,9 +582,13 @@ retry:
/*
* Dereference the reference we just created. This assumes
* that the object is associated with the vp.
+ *
+ * We don't need to vrele because the caller must hold a ref.
*/
object->ref_count--;
+ VI_LOCK(vp);
vp->v_usecount--;
+ VI_UNLOCK(vp);
} else {
if (object->flags & OBJ_DEAD) {
VOP_UNLOCK(vp, 0, td);
OpenPOWER on IntegriCloud