diff options
author | eivind <eivind@FreeBSD.org> | 1999-12-11 16:13:02 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1999-12-11 16:13:02 +0000 |
commit | 287836faea1ff2f002f4c9ea357e87cb7f2b4cd6 (patch) | |
tree | 9524fb381c1cbe8aed4ee0af7b1a693057985617 /sys/miscfs | |
parent | ff090abf5121f6bf2199248b70a4896d25f49550 (diff) | |
download | FreeBSD-src-287836faea1ff2f002f4c9ea357e87cb7f2b4cd6.zip FreeBSD-src-287836faea1ff2f002f4c9ea357e87cb7f2b4cd6.tar.gz |
Lock reporting and assertion changes.
* lockstatus() and VOP_ISLOCKED() gets a new process argument and a new
return value: LK_EXCLOTHER, when the lock is held exclusively by another
process.
* The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them
* Extend the vnode_if.src format to allow more exact specification than
locked/unlocked.
This commit should not do any semantic changes unless you are using
DEBUG_VFS_LOCKS.
Discussed with: grog, mch, peter, phk
Reviewed by: peter
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_vfsops.c | 2 | ||||
-rw-r--r-- | sys/miscfs/nullfs/null_vfsops.c | 6 | ||||
-rw-r--r-- | sys/miscfs/nullfs/null_vnops.c | 4 | ||||
-rw-r--r-- | sys/miscfs/union/union_vfsops.c | 9 | ||||
-rw-r--r-- | sys/miscfs/union/union_vnops.c | 8 |
5 files changed, 16 insertions, 13 deletions
diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index 287ca99..73f7d70 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -264,7 +264,7 @@ loop: if (vp->v_mount != mp) goto loop; nvp = vp->v_mntvnodes.le_next; - if (VOP_ISLOCKED(vp)) + if (VOP_ISLOCKED(vp, NULL)) continue; if (TAILQ_EMPTY(&vp->v_dirtyblkhd)) continue; diff --git a/sys/miscfs/nullfs/null_vfsops.c b/sys/miscfs/nullfs/null_vfsops.c index 06e1be0..e48a516 100644 --- a/sys/miscfs/nullfs/null_vfsops.c +++ b/sys/miscfs/nullfs/null_vfsops.c @@ -119,7 +119,7 @@ nullfs_mount(mp, path, data, ndp, p) * (XXX) VOP_ISLOCKED is needed? */ if ((mp->mnt_vnodecovered->v_op == null_vnodeop_p) && - VOP_ISLOCKED(mp->mnt_vnodecovered)) { + VOP_ISLOCKED(mp->mnt_vnodecovered, NULL)) { VOP_UNLOCK(mp->mnt_vnodecovered, 0, p); isvnunlocked = 1; } @@ -132,7 +132,7 @@ nullfs_mount(mp, path, data, ndp, p) /* * Re-lock vnode. */ - if (isvnunlocked && !VOP_ISLOCKED(mp->mnt_vnodecovered)) + if (isvnunlocked && !VOP_ISLOCKED(mp->mnt_vnodecovered, NULL)) vn_lock(mp->mnt_vnodecovered, LK_EXCLUSIVE | LK_RETRY, p); if (error) @@ -296,7 +296,7 @@ nullfs_root(mp, vpp) */ vp = MOUNTTONULLMOUNT(mp)->nullm_rootvp; VREF(vp); - if (VOP_ISLOCKED(vp)) { + if (VOP_ISLOCKED(vp, NULL)) { /* * XXX * Should we check type of node? diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c index 225ac09..9600f3c 100644 --- a/sys/miscfs/nullfs/null_vnops.c +++ b/sys/miscfs/nullfs/null_vnops.c @@ -372,13 +372,13 @@ null_lookup(ap) vp = *ap->a_vpp; if (dvp == vp) return (error); - if (!VOP_ISLOCKED(dvp)) { + if (!VOP_ISLOCKED(dvp, NULL)) { unlockargs.a_vp = dvp; unlockargs.a_flags = 0; unlockargs.a_p = p; vop_nounlock(&unlockargs); } - if (vp != NULLVP && VOP_ISLOCKED(vp)) { + if (vp != NULLVP && VOP_ISLOCKED(vp, NULL)) { lockargs.a_vp = vp; lockargs.a_flags = LK_SHARED; lockargs.a_p = p; diff --git a/sys/miscfs/union/union_vfsops.c b/sys/miscfs/union/union_vfsops.c index 1a53f88..ccd9a13 100644 --- a/sys/miscfs/union/union_vfsops.c +++ b/sys/miscfs/union/union_vfsops.c @@ -148,7 +148,8 @@ union_mount(mp, path, data, ndp, p) vrele(ndp->ni_dvp); ndp->ni_dvp = NULL; - UDEBUG(("mount_root UPPERVP %p locked = %d\n", upperrootvp, VOP_ISLOCKED(upperrootvp))); + UDEBUG(("mount_root UPPERVP %p locked = %d\n", upperrootvp, + VOP_ISLOCKED(upperrootvp, NULL))); /* * Check multi union mount to avoid `lock myself again' panic. @@ -396,7 +397,8 @@ union_root(mp, vpp) * root union_node being locked. We let union_allocvp() deal with * it. */ - UDEBUG(("union_root UPPERVP %p locked = %d\n", um->um_uppervp, VOP_ISLOCKED(um->um_uppervp))); + UDEBUG(("union_root UPPERVP %p locked = %d\n", um->um_uppervp, + VOP_ISLOCKED(um->um_uppervp, NULL))); VREF(um->um_uppervp); if (um->um_lowervp) @@ -405,7 +407,8 @@ union_root(mp, vpp) error = union_allocvp(vpp, mp, NULLVP, NULLVP, NULL, um->um_uppervp, um->um_lowervp, 1); UDEBUG(("error %d\n", error)); - UDEBUG(("union_root2 UPPERVP %p locked = %d\n", um->um_uppervp, VOP_ISLOCKED(um->um_uppervp))); + UDEBUG(("union_root2 UPPERVP %p locked = %d\n", um->um_uppervp, + VOP_ISLOCKED(um->um_uppervp, NULL))); return (error); } diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index 08763ce..5ab1036 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -363,10 +363,10 @@ union_lookup(ap) uerror, upperdvp, upperdvp->v_usecount, - VOP_ISLOCKED(upperdvp), + VOP_ISLOCKED(upperdvp, NULL), uppervp, (uppervp ? uppervp->v_usecount : -99), - (uppervp ? VOP_ISLOCKED(uppervp) : -99) + (uppervp ? VOP_ISLOCKED(uppervp, NULL) : -99) )); /* @@ -1698,7 +1698,7 @@ union_abortop(ap) struct componentname *cnp = ap->a_cnp; struct proc *p = cnp->cn_proc; struct union_node *un = VTOUNION(ap->a_dvp); - int islocked = VOP_ISLOCKED(ap->a_dvp); + int islocked = VOP_ISLOCKED(ap->a_dvp, NULL); struct vnode *vp; int error; @@ -1850,7 +1850,7 @@ union_unlock(ap) */ if ((un->un_flags & UN_ULOCK) && - lockstatus(&un->un_lock) != LK_EXCLUSIVE) { + lockstatus(&un->un_lock, NULL) != LK_EXCLUSIVE) { un->un_flags &= ~UN_ULOCK; VOP_UNLOCK(un->un_uppervp, LK_EXCLUSIVE, p); } |