summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/adosfs/adutil.c3
-rw-r--r--sys/adosfs/advnops.c7
-rw-r--r--sys/isofs/cd9660/cd9660_node.c5
-rw-r--r--sys/isofs/cd9660/cd9660_vnops.c7
-rw-r--r--sys/isofs/udf/udf_vnops.c7
-rw-r--r--sys/kern/vfs_default.c20
-rw-r--r--sys/kern/vfs_subr.c71
-rw-r--r--sys/kern/vfs_vnops.c8
-rw-r--r--sys/miscfs/deadfs/dead_vnops.c12
-rw-r--r--sys/msdosfs/msdosfs_denode.c5
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c5
-rw-r--r--sys/msdosfs/msdosfs_vnops.c7
-rw-r--r--sys/sys/vnode.h13
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c7
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c7
-rw-r--r--sys/ufs/ufs/ufs_ihash.c5
-rw-r--r--sys/ufs/ufs/ufs_quota.c21
-rw-r--r--sys/ufs/ufs/ufs_vnops.c13
-rw-r--r--sys/xfs/xfs_vnodeops-bsd.c4
19 files changed, 56 insertions, 171 deletions
diff --git a/sys/adosfs/adutil.c b/sys/adosfs/adutil.c
index 0b3cc2cf4bf..70c0130d282 100644
--- a/sys/adosfs/adutil.c
+++ b/sys/adosfs/adutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adutil.c,v 1.15 2005/11/19 02:18:00 pedro Exp $ */
+/* $OpenBSD: adutil.c,v 1.16 2007/03/21 17:29:31 thib Exp $ */
/* $NetBSD: adutil.c,v 1.15 1996/10/13 02:52:07 christos Exp $ */
/*
@@ -71,7 +71,6 @@ adosfs_ahashget(mp, an)
return (NULL);
if (ABLKTOINO(ap->block) == an) {
vp = ATOV(ap);
- simple_lock(&vp->v_interlock);
if (!vget(vp, LK_EXCLUSIVE, p))
return (vp);
break;
diff --git a/sys/adosfs/advnops.c b/sys/adosfs/advnops.c
index 897e931cc61..a679704ca2f 100644
--- a/sys/adosfs/advnops.c
+++ b/sys/adosfs/advnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: advnops.c,v 1.33 2007/01/16 17:52:18 thib Exp $ */
+/* $OpenBSD: advnops.c,v 1.34 2007/03/21 17:29:31 thib Exp $ */
/* $NetBSD: advnops.c,v 1.32 1996/10/13 02:52:09 christos Exp $ */
/*
@@ -499,7 +499,7 @@ adosfs_lock(v)
advopprint(ap);
#endif
- rv = lockmgr(&VTOA(vp)->a_lock, ap->a_flags, &vp->v_interlock);
+ rv = lockmgr(&VTOA(vp)->a_lock, ap->a_flags, NULL);
#ifdef ADOSFS_DIAGNOSTIC
printf(" %d)", rv);
@@ -524,8 +524,7 @@ adosfs_unlock(v)
advopprint(ap);
#endif
- rv = lockmgr(&VTOA(vp)->a_lock, ap->a_flags | LK_RELEASE,
- &vp->v_interlock);
+ rv = lockmgr(&VTOA(vp)->a_lock, ap->a_flags | LK_RELEASE, NULL);
#ifdef ADOSFS_DIAGNOSTIC
printf(" %d)", rv);
diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c
index c538b32f378..e5ed56609ec 100644
--- a/sys/isofs/cd9660/cd9660_node.c
+++ b/sys/isofs/cd9660/cd9660_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_node.c,v 1.16 2006/01/09 12:43:16 pedro Exp $ */
+/* $OpenBSD: cd9660_node.c,v 1.17 2007/03/21 17:29:31 thib Exp $ */
/* $NetBSD: cd9660_node.c,v 1.17 1997/05/05 07:13:57 mycroft Exp $ */
/*-
@@ -163,9 +163,8 @@ loop:
for (ip = isohashtbl[INOHASH(dev, inum)]; ip; ip = ip->i_next) {
if (inum == ip->i_number && dev == ip->i_dev) {
vp = ITOV(ip);
- simple_lock(&vp->v_interlock);
simple_unlock(&cd9660_ihash_slock);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p))
+ if (vget(vp, LK_EXCLUSIVE, p))
goto loop;
return (vp);
}
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c
index 6502c58573e..6433dd131a7 100644
--- a/sys/isofs/cd9660/cd9660_vnops.c
+++ b/sys/isofs/cd9660/cd9660_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vnops.c,v 1.38 2007/01/16 17:52:18 thib Exp $ */
+/* $OpenBSD: cd9660_vnops.c,v 1.39 2007/03/21 17:29:31 thib Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
@@ -880,7 +880,7 @@ cd9660_lock(v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, &vp->v_interlock));
+ return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, NULL));
}
/*
@@ -895,8 +895,7 @@ cd9660_unlock(v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags | LK_RELEASE,
- &vp->v_interlock));
+ return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags | LK_RELEASE, NULL));
}
/*
diff --git a/sys/isofs/udf/udf_vnops.c b/sys/isofs/udf/udf_vnops.c
index 72e7198b94a..c01ffcd541f 100644
--- a/sys/isofs/udf/udf_vnops.c
+++ b/sys/isofs/udf/udf_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vnops.c,v 1.21 2006/10/16 11:27:53 pedro Exp $ */
+/* $OpenBSD: udf_vnops.c,v 1.22 2007/03/21 17:29:31 thib Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -911,7 +911,7 @@ udf_lock(void *v)
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTOU(vp)->u_lock, ap->a_flags, &vp->v_interlock));
+ return (lockmgr(&VTOU(vp)->u_lock, ap->a_flags, NULL));
}
int
@@ -925,8 +925,7 @@ udf_unlock(void *v)
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTOU(vp)->u_lock, ap->a_flags | LK_RELEASE,
- &vp->v_interlock));
+ return (lockmgr(&VTOU(vp)->u_lock, ap->a_flags | LK_RELEASE, NULL));
}
int
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index da7b13db6a9..cdd2a7daefb 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_default.c,v 1.31 2007/01/16 17:52:18 thib Exp $ */
+/* $OpenBSD: vfs_default.c,v 1.32 2007/03/21 17:29:31 thib Exp $ */
/*
* Portions of this code are:
@@ -73,7 +73,6 @@ vop_generic_revoke(void *v)
#endif
vp = ap->a_vp;
- simple_lock(&vp->v_interlock);
if (vp->v_flag & VALIASED) {
/*
@@ -82,7 +81,6 @@ vop_generic_revoke(void *v)
*/
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
- simple_unlock(&vp->v_interlock);
tsleep(vp, PINOD, "vop_generic_revokeall", 0);
return(0);
@@ -93,7 +91,6 @@ vop_generic_revoke(void *v)
* are eliminating its aliases.
*/
vp->v_flag |= VXLOCK;
- simple_unlock(&vp->v_interlock);
while (vp->v_flag & VALIASED) {
simple_lock(&spechash_slock);
for (vq = *vp->v_hashchain; vq; vq = vq->v_specnext) {
@@ -112,7 +109,6 @@ vop_generic_revoke(void *v)
* really eliminate the vnode after which time
* vgone will awaken any sleepers.
*/
- simple_lock(&vp->v_interlock);
vp->v_flag &= ~VXLOCK;
}
@@ -154,20 +150,6 @@ vop_generic_abortop(void *v)
int
vop_generic_lock(void *v)
{
- struct vop_lock_args /* {
- struct vnodeop_desc *a_desc;
- struct vnode *a_vp;
- int a_flags;
- struct proc *a_p;
- } */ *ap = v;
-
- /*
- * Since we are not using the lock manager, we must clear
- * the interlock here.
- */
- if (ap->a_flags & LK_INTERLOCK)
- simple_unlock(&ap->a_vp->v_interlock);
-
return (0);
}
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index de843b98e08..cb951ea6060 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.140 2007/03/12 19:25:58 mickey Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.141 2007/03/21 17:29:31 thib Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -385,17 +385,12 @@ getnewvnode(enum vtagtype tag, struct mount *mp, int (**vops)(void *),
simple_unlock(&vnode_free_list_slock);
vp = pool_get(&vnode_pool, PR_WAITOK);
bzero((char *)vp, sizeof *vp);
- simple_lock_init(&vp->v_interlock);
numvnodes++;
} else {
for (vp = TAILQ_FIRST(listhd); vp != NULLVP;
vp = TAILQ_NEXT(vp, v_freelist)) {
- if (simple_lock_try(&vp->v_interlock)) {
- if (VOP_ISLOCKED(vp) == 0)
- break;
- else
- simple_unlock(&vp->v_interlock);
- }
+ if (VOP_ISLOCKED(vp) == 0)
+ break;
}
/*
* Unless this is a bad time of the month, at most
@@ -424,8 +419,6 @@ getnewvnode(enum vtagtype tag, struct mount *mp, int (**vops)(void *),
simple_unlock(&vnode_free_list_slock);
if (vp->v_type != VBAD)
vgonel(vp, p);
- else
- simple_unlock(&vp->v_interlock);
#ifdef DIAGNOSTIC
if (vp->v_data) {
vprint("cleaned vnode", vp);
@@ -547,9 +540,7 @@ checkalias(struct vnode *nvp, dev_t nvp_rdev, struct mount *mp)
loop:
simple_lock(&spechash_slock);
for (vp = *vpp; vp; vp = vp->v_specnext) {
- simple_lock(&vp->v_interlock);
if (nvp_rdev != vp->v_rdev || nvp->v_type != vp->v_type) {
- simple_unlock(&vp->v_interlock);
continue;
}
/*
@@ -560,7 +551,7 @@ loop:
vgonel(vp, p);
goto loop;
}
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
+ if (vget(vp, LK_EXCLUSIVE, p)) {
simple_unlock(&spechash_slock);
goto loop;
}
@@ -602,7 +593,6 @@ loop:
simple_unlock(&spechash_slock);
VOP_UNLOCK(vp, 0, p);
- simple_lock(&vp->v_interlock);
vclean(vp, 0, p);
vp->v_op = nvp->v_op;
vp->v_tag = nvp->v_tag;
@@ -631,21 +621,16 @@ vget(struct vnode *vp, int flags, struct proc *p)
* return failure. Cleaning is determined by checking that
* the VXLOCK flag is set.
*/
- if ((flags & LK_INTERLOCK) == 0) {
- simple_lock(&vp->v_interlock);
- flags |= LK_INTERLOCK;
- }
if (vp->v_flag & VXLOCK) {
if (flags & LK_NOWAIT) {
- simple_unlock(&vp->v_interlock);
return (EBUSY);
}
- vp->v_flag |= VXWANT;
- ltsleep(vp, PINOD | PNORELOCK, "vget", 0, &vp->v_interlock);
+ vp->v_flag |= VXWANT;
+ ltsleep(vp, PINOD | PNORELOCK, "vget", 0, NULL);
return (ENOENT);
- }
+ }
onfreelist = vp->v_bioflag & VBIOONFREELIST;
if (vp->v_usecount == 0 && onfreelist) {
@@ -666,14 +651,10 @@ vget(struct vnode *vp, int flags, struct proc *p)
vp->v_usecount--;
if (vp->v_usecount == 0 && onfreelist)
vputonfreelist(vp);
-
- simple_unlock(&vp->v_interlock);
}
return (error);
}
- simple_unlock(&vp->v_interlock);
-
return (0);
}
@@ -685,11 +666,9 @@ vget(struct vnode *vp, int flags, struct proc *p)
void
vref(struct vnode *vp)
{
- simple_lock(&vp->v_interlock);
if (vp->v_usecount == 0)
panic("vref used where vget required");
vp->v_usecount++;
- simple_unlock(&vp->v_interlock);
}
#endif /* DIAGNOSTIC */
@@ -737,7 +716,6 @@ vput(struct vnode *vp)
if (vp == NULL)
panic("vput: null vp");
#endif
- simple_lock(&vp->v_interlock);
#ifdef DIAGNOSTIC
if (vp->v_usecount == 0) {
@@ -747,7 +725,6 @@ vput(struct vnode *vp)
#endif
vp->v_usecount--;
if (vp->v_usecount > 0) {
- simple_unlock(&vp->v_interlock);
VOP_UNLOCK(vp, 0, p);
return;
}
@@ -758,16 +735,11 @@ vput(struct vnode *vp)
panic("vput: v_writecount != 0");
}
#endif
- simple_unlock(&vp->v_interlock);
VOP_INACTIVE(vp, p);
- simple_lock(&vp->v_interlock);
-
if (vp->v_usecount == 0 && !(vp->v_bioflag & VBIOONFREELIST))
vputonfreelist(vp);
-
- simple_unlock(&vp->v_interlock);
}
/*
@@ -783,7 +755,6 @@ vrele(struct vnode *vp)
if (vp == NULL)
panic("vrele: null vp");
#endif
- simple_lock(&vp->v_interlock);
#ifdef DIAGNOSTIC
if (vp->v_usecount == 0) {
vprint("vrele: bad ref count", vp);
@@ -792,7 +763,6 @@ vrele(struct vnode *vp)
#endif
vp->v_usecount--;
if (vp->v_usecount > 0) {
- simple_unlock(&vp->v_interlock);
return;
}
@@ -803,7 +773,7 @@ vrele(struct vnode *vp)
}
#endif
- if (vn_lock(vp, LK_EXCLUSIVE|LK_INTERLOCK, p)) {
+ if (vn_lock(vp, LK_EXCLUSIVE, p)) {
#ifdef DIAGNOSTIC
vprint("vrele: cannot lock", vp);
#endif
@@ -812,12 +782,8 @@ vrele(struct vnode *vp)
VOP_INACTIVE(vp, p);
- simple_lock(&vp->v_interlock);
-
if (vp->v_usecount == 0 && !(vp->v_bioflag & VBIOONFREELIST))
vputonfreelist(vp);
-
- simple_unlock(&vp->v_interlock);
}
void vhold(struct vnode *vp);
@@ -832,7 +798,6 @@ vhold(struct vnode *vp)
* If it is on the freelist and the hold count is currently
* zero, move it to the hold list.
*/
- simple_lock(&vp->v_interlock);
if ((vp->v_bioflag & VBIOONFREELIST) &&
vp->v_holdcnt == 0 && vp->v_usecount == 0) {
simple_lock(&vnode_free_list_slock);
@@ -841,7 +806,6 @@ vhold(struct vnode *vp)
simple_unlock(&vnode_free_list_slock);
}
vp->v_holdcnt++;
- simple_unlock(&vp->v_interlock);
}
/*
@@ -869,7 +833,6 @@ loop:
if (vp->v_mount != mp)
goto loop;
nvp = LIST_NEXT(vp, v_mntvnodes);
- simple_lock(&vp->v_interlock);
simple_unlock(&mntvnode_slock);
error = func(vp, arg);
@@ -896,12 +859,10 @@ vflush_vnode(struct vnode *vp, void *arg) {
struct proc *p = curproc;
if (vp == va->skipvp) {
- simple_unlock(&vp->v_interlock);
return (0);
}
if ((va->flags & SKIPSYSTEM) && (vp->v_flag & VSYSTEM)) {
- simple_unlock(&vp->v_interlock);
return (0);
}
@@ -911,7 +872,6 @@ vflush_vnode(struct vnode *vp, void *arg) {
*/
if ((va->flags & WRITECLOSE) &&
(vp->v_writecount == 0 || vp->v_type != VREG)) {
- simple_unlock(&vp->v_interlock);
return (0);
}
@@ -944,7 +904,6 @@ vflush_vnode(struct vnode *vp, void *arg) {
if (busyprt)
vprint("vflush: busy vnode", vp);
#endif
- simple_unlock(&vp->v_interlock);
va->busy++;
return (0);
}
@@ -996,7 +955,7 @@ vclean(struct vnode *vp, int flags, struct proc *p)
* For active vnodes, it ensures that no other activity can
* occur while the underlying object is being cleaned out.
*/
- VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK, p);
+ VOP_LOCK(vp, LK_DRAIN, p);
/*
* Clean out any VM data associated with the vnode.
@@ -1030,16 +989,12 @@ vclean(struct vnode *vp, int flags, struct proc *p)
if (VOP_RECLAIM(vp, p))
panic("vclean: cannot reclaim");
if (active) {
- simple_lock(&vp->v_interlock);
-
vp->v_usecount--;
if (vp->v_usecount == 0) {
if (vp->v_holdcnt > 0)
panic("vclean: not clean");
vputonfreelist(vp);
}
-
- simple_unlock(&vp->v_interlock);
}
cache_purge(vp);
@@ -1068,14 +1023,12 @@ vclean(struct vnode *vp, int flags, struct proc *p)
int
vrecycle(struct vnode *vp, struct simplelock *inter_lkp, struct proc *p)
{
- simple_lock(&vp->v_interlock);
if (vp->v_usecount == 0) {
if (inter_lkp)
simple_unlock(inter_lkp);
vgonel(vp, p);
return (1);
}
- simple_unlock(&vp->v_interlock);
return (0);
}
@@ -1087,8 +1040,6 @@ void
vgone(struct vnode *vp)
{
struct proc *p = curproc;
-
- simple_lock (&vp->v_interlock);
vgonel(vp, p);
}
@@ -1109,7 +1060,7 @@ vgonel(struct vnode *vp, struct proc *p)
*/
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
- ltsleep(vp, PINOD | PNORELOCK, "vgone", 0, &vp->v_interlock);
+ ltsleep(vp, PINOD | PNORELOCK, "vgone", 0, NULL);
return;
}
@@ -2098,7 +2049,6 @@ brelvp(struct buf *bp)
}
bp->b_vp = (struct vnode *) 0;
- simple_lock(&vp->v_interlock);
#ifdef DIAGNOSTIC
if (vp->v_holdcnt == 0)
panic("brelvp: holdcnt");
@@ -2116,7 +2066,6 @@ brelvp(struct buf *bp)
TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist);
simple_unlock(&vnode_free_list_slock);
}
- simple_unlock(&vp->v_interlock);
}
/*
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 02e5b818a8c..cedd61b84c3 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vnops.c,v 1.54 2007/01/16 17:52:18 thib Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.55 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
@@ -465,19 +465,15 @@ vn_lock(struct vnode *vp, int flags, struct proc *p)
flags |= LK_CANRECURSE;
do {
- if ((flags & LK_INTERLOCK) == 0)
- simple_lock(&vp->v_interlock);
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
- simple_unlock(&vp->v_interlock);
tsleep(vp, PINOD, "vn_lock", 0);
error = ENOENT;
} else {
- error = VOP_LOCK(vp, flags | LK_INTERLOCK, p);
+ error = VOP_LOCK(vp, flags, p);
if (error == 0)
return (error);
}
- flags &= ~LK_INTERLOCK;
} while (flags & LK_RETRY);
return (error);
}
diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c
index b91827115bc..0e511ad245a 100644
--- a/sys/miscfs/deadfs/dead_vnops.c
+++ b/sys/miscfs/deadfs/dead_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dead_vnops.c,v 1.15 2003/09/23 16:51:12 millert Exp $ */
+/* $OpenBSD: dead_vnops.c,v 1.16 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */
/*
@@ -279,16 +279,8 @@ dead_lock(v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- /*
- * Since we are not using the lock manager, we must clear
- * the interlock here.
- */
- if (ap->a_flags & LK_INTERLOCK) {
- simple_unlock(&vp->v_interlock);
- ap->a_flags &= ~LK_INTERLOCK;
- }
if (ap->a_flags & LK_DRAIN || !chkvnlock(vp))
- return (0);
+ return (0);
return (VCALL(vp, VOFFSET(vop_lock), ap));
}
diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c
index eb219370b9e..92865149dff 100644
--- a/sys/msdosfs/msdosfs_denode.c
+++ b/sys/msdosfs/msdosfs_denode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_denode.c,v 1.28 2006/01/09 12:43:16 pedro Exp $ */
+/* $OpenBSD: msdosfs_denode.c,v 1.29 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.23 1997/10/17 11:23:58 ws Exp $ */
/*-
@@ -105,8 +105,7 @@ msdosfs_hashget(dev, dirclust, diroff)
dep->de_refcnt != 0) {
struct vnode *vp = DETOV(dep);
- simple_lock(&vp->v_interlock);
- if (!vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p))
+ if (!vget(vp, LK_EXCLUSIVE, p))
return (dep);
break;
}
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index c3442966cc1..f99123197c5 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.46 2006/12/16 12:44:05 krw Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.47 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
@@ -678,11 +678,10 @@ msdosfs_sync_vnode(struct vnode *vp, void *arg)
((dep->de_flag & (DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0
&& LIST_EMPTY(&vp->v_dirtyblkhd)) ||
msa->waitfor == MNT_LAZY) {
- simple_unlock(&vp->v_interlock);
return (0);
}
- if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, msa->p))
+ if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT, msa->p))
return (0);
if ((error = VOP_FSYNC(vp, msa->cred, msa->waitfor, msa->p)) != 0)
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index 62af2a2dcd9..01bc8a70a89 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vnops.c,v 1.60 2007/03/18 15:05:33 mickey Exp $ */
+/* $OpenBSD: msdosfs_vnops.c,v 1.61 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */
/*-
@@ -1745,7 +1745,7 @@ msdosfs_lock(v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags, &vp->v_interlock));
+ return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags, NULL));
}
int
@@ -1757,8 +1757,7 @@ msdosfs_unlock(v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags | LK_RELEASE,
- &vp->v_interlock));
+ return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags | LK_RELEASE, NULL));
}
int
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 2940b85303d..a3cbf8b83a0 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.74 2007/02/26 11:25:23 pedro Exp $ */
+/* $OpenBSD: vnode.h,v 1.75 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -79,14 +79,6 @@ enum vtagtype {
*/
LIST_HEAD(buflists, buf);
-/*
- * Reading or writing any of these items requires holding the appropriate lock.
- * v_freelist is locked by the global vnode_free_list simple lock.
- * v_mntvnodes is locked by the global mntvnodes simple lock.
- * v_flag, v_usecount, v_holdcount and v_writecount are
- * locked by the v_interlock simple lock.
- */
-
struct vnode {
struct uvm_vnode v_uvm; /* uvm data */
int (**v_op)(void *); /* vnode operations vector */
@@ -113,7 +105,6 @@ struct vnode {
struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */
} v_un;
- struct simplelock v_interlock; /* lock on usecount and flag */
enum vtagtype v_tag; /* type of underlying data */
void *v_data; /* private data for fs */
struct {
@@ -255,9 +246,7 @@ static __inline void
vref(vp)
struct vnode *vp;
{
- simple_lock(&vp->v_interlock);
vp->v_usecount++;
- simple_unlock(&vp->v_interlock);
}
#endif /* DIAGNOSTIC */
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c
index 5008b7531de..da455e7b9ac 100644
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vfsops.c,v 1.45 2006/04/19 11:55:55 pedro Exp $ */
+/* $OpenBSD: ext2fs_vfsops.c,v 1.46 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */
/*
@@ -350,7 +350,7 @@ ext2fs_reload_vnode(struct vnode *vp, void *args) {
/*
* Step 5: invalidate all cached file data.
*/
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, era->p))
+ if (vget(vp, LK_EXCLUSIVE, era->p))
return (0);
if (vinvalbuf(vp, 0, era->cred, era->p, 0, 0))
@@ -752,11 +752,10 @@ ext2fs_sync_vnode(struct vnode *vp, void *args)
((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
LIST_EMPTY(&vp->v_dirtyblkhd)) ||
esa->waitfor == MNT_LAZY) {
- simple_unlock(&vp->v_interlock);
return (0);
}
- if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, esa->p))
+ if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT, esa->p))
return (0);
if ((error = VOP_FSYNC(vp, esa->cred, esa->waitfor, esa->p)) != 0)
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 1d9e877216f..637c9095973 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vfsops.c,v 1.100 2007/03/19 19:57:58 pedro Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.101 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -480,7 +480,7 @@ ffs_reload_vnode(struct vnode *vp, void *args)
/*
* Step 5: invalidate all cached file data.
*/
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, fra->p))
+ if (vget(vp, LK_EXCLUSIVE, fra->p))
return (0);
if (vinvalbuf(vp, 0, fra->cred, fra->p, 0, 0))
@@ -1145,11 +1145,10 @@ ffs_sync_vnode(struct vnode *vp, void *arg) {
((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
LIST_EMPTY(&vp->v_dirtyblkhd)) ) {
- simple_unlock(&vp->v_interlock);
return (0);
}
- if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, fsa->p))
+ if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT, fsa->p))
return (0);
if ((error = VOP_FSYNC(vp, fsa->cred, fsa->waitfor, fsa->p)))
diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c
index 6d6beb4c6a2..d40cb40fd8c 100644
--- a/sys/ufs/ufs/ufs_ihash.c
+++ b/sys/ufs/ufs/ufs_ihash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_ihash.c,v 1.12 2005/11/19 02:18:02 pedro Exp $ */
+/* $OpenBSD: ufs_ihash.c,v 1.13 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: ufs_ihash.c,v 1.3 1996/02/09 22:36:04 christos Exp $ */
/*
@@ -96,9 +96,8 @@ loop:
LIST_FOREACH(ip, INOHASH(dev, inum), i_hash) {
if (inum == ip->i_number && dev == ip->i_dev) {
vp = ITOV(ip);
- simple_lock(&vp->v_interlock);
simple_unlock(&ufs_ihash_slock);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p))
+ if (vget(vp, LK_EXCLUSIVE, p))
goto loop;
return (vp);
}
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 876e31a727d..761eb2784f5 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_quota.c,v 1.26 2007/02/14 00:53:48 jsg Exp $ */
+/* $OpenBSD: ufs_quota.c,v 1.27 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */
/*
@@ -462,12 +462,10 @@ quotaon_vnode(struct vnode *vp, void *arg)
int error;
struct proc *p = (struct proc *)arg;
- if (vp->v_type == VNON || vp->v_writecount == 0) {
- simple_unlock(&vp->v_interlock);
+ if (vp->v_type == VNON || vp->v_writecount == 0)
return (0);
- }
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
+ if (vget(vp, LK_EXCLUSIVE, p)) {
return (0);
}
@@ -550,12 +548,11 @@ quotaoff_vnode(struct vnode *vp, void *arg)
struct inode *ip;
struct dquot *dq;
- if (vp->v_type == VNON) {
- simple_unlock(&vp->v_interlock);
+ if (vp->v_type == VNON)
return (0);
- }
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, qa->p))
+
+ if (vget(vp, LK_EXCLUSIVE, qa->p))
return (0);
ip = VTOI(vp);
dq = ip->i_dquot[qa->type];
@@ -726,12 +723,10 @@ qsync_vnode(struct vnode *vp, void *arg)
struct proc *p = curproc;
struct dquot *dq;
- if (vp->v_type == VNON) {
- simple_unlock(&vp->v_interlock);
+ if (vp->v_type == VNON)
return (0);
- }
- if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p))
+ if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT, p))
return (0);
for (i = 0; i < MAXQUOTAS; i++) {
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 926a8f322b9..04c3fbfb17c 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_vnops.c,v 1.73 2006/12/29 13:04:37 pedro Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.74 2007/03/21 17:29:32 thib Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
@@ -226,14 +226,12 @@ ufs_close(void *v)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
- simple_lock(&vp->v_interlock);
if (vp->v_usecount > 1) {
struct timeval tv;
getmicrotime(&tv);
ITIMES(ip, &tv, &tv);
}
- simple_unlock(&vp->v_interlock);
return (0);
}
@@ -1623,7 +1621,7 @@ ufs_lock(void *v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, &vp->v_interlock));
+ return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, NULL));
}
/*
@@ -1639,8 +1637,7 @@ ufs_unlock(void *v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags | LK_RELEASE,
- &vp->v_interlock));
+ return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags | LK_RELEASE, NULL));
}
/*
@@ -1791,14 +1788,12 @@ ufsspec_close(void *v)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
- simple_lock(&vp->v_interlock);
if (ap->a_vp->v_usecount > 1) {
struct timeval tv;
getmicrotime(&tv);
ITIMES(ip, &tv, &tv);
}
- simple_unlock(&vp->v_interlock);
return (VOCALL (spec_vnodeop_p, VOFFSET(vop_close), ap));
}
@@ -1863,14 +1858,12 @@ ufsfifo_close(void *v)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
- simple_lock(&vp->v_interlock);
if (ap->a_vp->v_usecount > 1) {
struct timeval tv;
getmicrotime(&tv);
ITIMES(ip, &tv, &tv);
}
- simple_unlock(&vp->v_interlock);
return (VOCALL (fifo_vnodeop_p, VOFFSET(vop_close), ap));
}
#endif /* FIFO */
diff --git a/sys/xfs/xfs_vnodeops-bsd.c b/sys/xfs/xfs_vnodeops-bsd.c
index cafe22459ca..90459965856 100644
--- a/sys/xfs/xfs_vnodeops-bsd.c
+++ b/sys/xfs/xfs_vnodeops-bsd.c
@@ -803,7 +803,7 @@ xfs_lock(struct vop_lock_args * ap)
ret = lockmgr(l, flags, &vp->v_interlock, ap->a_p);
#endif
#else
- ret = lockmgr(l, flags, &vp->v_interlock);
+ ret = lockmgr(l, flags, NULL);
#endif
#else
#ifdef HAVE_FREEBSD_THREAD
@@ -857,7 +857,7 @@ xfs_unlock(struct vop_unlock_args * ap)
ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_p);
#endif
#else
- ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock);
+ ret = lockmgr (l, flags | LK_RELEASE, NULL);
#endif
#else
#ifdef HAVE_FREEBSD_THREAD