summaryrefslogtreecommitdiffstats
path: root/sys/fs/deadfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-02-17 10:49:51 +0000
committerphk <phk@FreeBSD.org>2005-02-17 10:49:51 +0000
commitaf1fa2025c1adbd3aa43852fd421e5de95e7e48a (patch)
treec6ca1c2d787f19fc07fe230b8960fbd1ed235cbb /sys/fs/deadfs
parentb6768ad7ab5e57fa2022ae70c6a59bf4b89bdfb8 (diff)
downloadFreeBSD-src-af1fa2025c1adbd3aa43852fd421e5de95e7e48a.zip
FreeBSD-src-af1fa2025c1adbd3aa43852fd421e5de95e7e48a.tar.gz
Introduce vx_wait{l}() and use it instead of home-rolled versions.
Diffstat (limited to 'sys/fs/deadfs')
-rw-r--r--sys/fs/deadfs/dead_vnops.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c
index 3d3a65a..ca32893 100644
--- a/sys/fs/deadfs/dead_vnops.c
+++ b/sys/fs/deadfs/dead_vnops.c
@@ -38,7 +38,6 @@
#include <sys/poll.h>
#include <sys/vnode.h>
-static int chkvnlock(struct vnode *);
/*
* Prototypes for dead operations on vnodes.
*/
@@ -129,7 +128,7 @@ dead_read(ap)
} */ *ap;
{
- if (chkvnlock(ap->a_vp))
+ if (vx_wait(ap->a_vp))
panic("dead_read: lock");
/*
* Return EOF for tty devices, EIO for others
@@ -153,7 +152,7 @@ dead_write(ap)
} */ *ap;
{
- if (chkvnlock(ap->a_vp))
+ if (vx_wait(ap->a_vp))
panic("dead_write: lock");
return (EIO);
}
@@ -174,7 +173,7 @@ dead_ioctl(ap)
} */ *ap;
{
- if (!chkvnlock(ap->a_vp))
+ if (!vx_wait(ap->a_vp))
return (ENOTTY);
/* XXX: Doesn't this just recurse back here ? */
return (VOP_IOCTL_AP(ap));
@@ -202,7 +201,7 @@ dead_lock(ap)
mtx_unlock(&vp->v_interlock);
ap->a_flags &= ~LK_INTERLOCK;
}
- if (!chkvnlock(vp))
+ if (!vx_wait(vp))
return (0);
return (VOP_LOCK_AP(ap));
}
@@ -222,32 +221,12 @@ dead_bmap(ap)
} */ *ap;
{
- if (!chkvnlock(ap->a_vp))
+ if (!vx_wait(ap->a_vp))
return (EIO);
return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_bop, ap->a_bnp, ap->a_runp, ap->a_runb));
}
/*
- * We have to wait during times when the vnode is
- * in a state of change.
- */
-static int
-chkvnlock(vp)
- register struct vnode *vp;
-{
- int locked = 0;
-
- VI_LOCK(vp);
- while (vp->v_iflag & VI_XLOCK) {
- vp->v_iflag |= VI_XWANT;
- (void) msleep((caddr_t)vp, VI_MTX(vp), PINOD, "ckvnlk", 0);
- locked = 1;
- }
- VI_UNLOCK(vp);
- return (locked);
-}
-
-/*
* Trivial poll routine that always returns POLLHUP.
* This is necessary so that a process which is polling a file
* gets notified when that file is revoke()d.
OpenPOWER on IntegriCloud