summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-12-19 08:58:08 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-12-19 08:58:08 +0000
commitd8afae924f4db99650aa0df115c6ae66ed02b950 (patch)
treea2cbc045f0eb624a394f8e45fea1a58ecf1faaf0 /sys/kern/vfs_vnops.c
parent4a6c79ff4f05aaae32458104529a9a9e0d3d208b (diff)
UBC was a disaster. It worked very good when it worked, but on some
machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index a788a93c9df..8314a049da7 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vnops.c,v 1.38 2001/12/10 18:45:34 art Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.39 2001/12/19 08:58:06 art Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
@@ -165,11 +165,6 @@ vn_open(ndp, fmode, cmode)
}
if ((error = VOP_OPEN(vp, fmode, cred, p)) != 0)
goto bad;
- if (vp->v_type == VREG &&
- uvn_attach(vp, fmode & FWRITE ? VM_PROT_WRITE : 0) == NULL) {
- error = EIO;
- goto bad;
- }
if (fmode & FWRITE)
vp->v_writecount++;
return (0);
@@ -202,10 +197,11 @@ vn_writechk(vp)
}
}
/*
- * If the vnode is in use as a process's text,
- * we can't allow writing.
+ * If there's shared text associated with
+ * the vnode, try to free it up once. If
+ * we fail, we can't allow writing.
*/
- if (vp->v_flag & VTEXT)
+ if ((vp->v_flag & VTEXT) && !uvm_vnp_uncache(vp))
return (ETXTBSY);
return (0);
@@ -218,23 +214,6 @@ void
vn_marktext(vp)
struct vnode *vp;
{
- if ((vp->v_flag & VTEXT) == 0) {
- uvmexp.vnodepages -= vp->v_uobj.uo_npages;
- uvmexp.vtextpages += vp->v_uobj.uo_npages;
-#if 0
- /*
- * Doesn't help much because the pager is borked and ubc_flush is
- * slow.
- */
-#ifdef PMAP_PREFER
- /*
- * Get rid of any cached reads from this vnode.
- * exec can't respect PMAP_PREFER when mapping the text.
- */
- ubc_flush(&vp->v_uobj, 0, 0);
-#endif
-#endif
- }
vp->v_flag |= VTEXT;
}
@@ -521,10 +500,6 @@ vn_lock(vp, flags, p)
if ((flags & LK_INTERLOCK) == 0)
simple_lock(&vp->v_interlock);
if (vp->v_flag & VXLOCK) {
- if (flags & LK_NOWAIT) {
- simple_unlock(&vp->v_interlock);
- return (EBUSY);
- }
vp->v_flag |= VXWANT;
simple_unlock(&vp->v_interlock);
tsleep((caddr_t)vp, PINOD, "vn_lock", 0);