diff options
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_lock.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 11 | ||||
-rw-r--r-- | sys/nfs4client/nfs4_vfsops.c | 2 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 2 |
5 files changed, 13 insertions, 12 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index e2e48dd..95914f4 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -107,7 +107,7 @@ nullfs_mount(struct mount *mp, struct thread *td) * (XXX) VOP_ISLOCKED is needed? */ if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) && - VOP_ISLOCKED(mp->mnt_vnodecovered, NULL)) { + VOP_ISLOCKED(mp->mnt_vnodecovered, curthread)) { VOP_UNLOCK(mp->mnt_vnodecovered, 0); isvnunlocked = 1; } @@ -120,7 +120,7 @@ nullfs_mount(struct mount *mp, struct thread *td) /* * Re-lock vnode. */ - if (isvnunlocked && !VOP_ISLOCKED(mp->mnt_vnodecovered, NULL)) + if (isvnunlocked && !VOP_ISLOCKED(mp->mnt_vnodecovered, curthread)) vn_lock(mp->mnt_vnodecovered, LK_EXCLUSIVE | LK_RETRY); if (error) @@ -247,7 +247,7 @@ nullfs_root(mp, flags, vpp, td) VREF(vp); #ifdef NULLFS_DEBUG - if (VOP_ISLOCKED(vp, NULL)) + if (VOP_ISLOCKED(vp, curthread)) panic("root vnode is locked.\n"); #endif vn_lock(vp, flags | LK_RETRY); diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 877b401..d64b354 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -606,7 +606,7 @@ lockstatus(lkp, td) int lock_type = 0; int interlocked; - KASSERT(td == NULL || td == curthread, + KASSERT(td == curthread, ("%s: thread passed argument (%p) is not valid", __func__, td)); if (!kdb_active) { @@ -615,7 +615,7 @@ lockstatus(lkp, td) } else interlocked = 0; if (lkp->lk_exclusivecount != 0) { - if (td == NULL || lkp->lk_lockholder == td) + if (lkp->lk_lockholder == td) lock_type = LK_EXCLUSIVE; else lock_type = LK_EXCLOTHER; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 8095974..d44510b 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1638,7 +1638,7 @@ restart: VFS_UNLOCK_GIANT(vfslocked); vfslocked = 0; } - if (VOP_ISLOCKED(vp, NULL) != 0) { + if (VOP_ISLOCKED(vp, curthread) != 0) { VFS_UNLOCK_GIANT(vfslocked); return (1); } @@ -2208,7 +2208,7 @@ vput(struct vnode *vp) */ v_decr_useonly(vp); vp->v_iflag |= VI_OWEINACT; - if (VOP_ISLOCKED(vp, NULL) != LK_EXCLUSIVE) { + if (VOP_ISLOCKED(vp, curthread) != LK_EXCLUSIVE) { error = VOP_LOCK(vp, LK_UPGRADE|LK_INTERLOCK|LK_NOWAIT); VI_LOCK(vp); if (error) { @@ -2684,7 +2684,8 @@ DB_SHOW_COMMAND(lockedvnods, lockedvnodes) for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { nmp = TAILQ_NEXT(mp, mnt_list); TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { - if (vp->v_type != VMARKER && VOP_ISLOCKED(vp, NULL)) + if (vp->v_type != VMARKER && + VOP_ISLOCKED(vp, curthread)) vprint("", vp); } nmp = TAILQ_NEXT(mp, mnt_list); @@ -2971,7 +2972,7 @@ vfs_msync(struct mount *mp, int flags) MNT_VNODE_FOREACH(vp, mp, mvp) { VI_LOCK(vp); if ((vp->v_iflag & VI_OBJDIRTY) && - (flags == MNT_WAIT || VOP_ISLOCKED(vp, NULL) == 0)) { + (flags == MNT_WAIT || VOP_ISLOCKED(vp, curthread) == 0)) { MNT_IUNLOCK(mp); if (!vget(vp, LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK, @@ -3478,7 +3479,7 @@ void assert_vop_locked(struct vnode *vp, const char *str) { - if (vp && !IGNORE_LOCK(vp) && VOP_ISLOCKED(vp, NULL) == 0) + if (vp && !IGNORE_LOCK(vp) && VOP_ISLOCKED(vp, curthread) == 0) vfs_badlock("is not locked but should be", str, vp); } diff --git a/sys/nfs4client/nfs4_vfsops.c b/sys/nfs4client/nfs4_vfsops.c index 3efc077..c83896b 100644 --- a/sys/nfs4client/nfs4_vfsops.c +++ b/sys/nfs4client/nfs4_vfsops.c @@ -749,7 +749,7 @@ loop: MNT_VNODE_FOREACH(vp, mp, mvp) { VI_LOCK(vp); MNT_IUNLOCK(mp); - if (VOP_ISLOCKED(vp, NULL) || + if (VOP_ISLOCKED(vp, curthread) || vp->v_bufobj.bo_dirty.bv_cnt == 0 || waitfor == MNT_LAZY) { VI_UNLOCK(vp); diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index d2f4924..e707d9c 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -1050,7 +1050,7 @@ loop: MNT_VNODE_FOREACH(vp, mp, mvp) { VI_LOCK(vp); MNT_IUNLOCK(mp); - if (VOP_ISLOCKED(vp, NULL) || + if (VOP_ISLOCKED(vp, curthread) || vp->v_bufobj.bo_dirty.bv_cnt == 0 || waitfor == MNT_LAZY) { VI_UNLOCK(vp); |