diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 04:51:18 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 04:51:18 +0000 |
commit | 52b4d7fbde220c6651b33720adb78ce6728e00b1 (patch) | |
tree | b1934f0b4af62c93bfb43d86689bc1e077bd1598 /sys/kern | |
parent | bc8986d97d2f8474b598194a210a6aa5338280b4 (diff) |
adaptation to uvm vnode pager
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 23 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 11 |
2 files changed, 31 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 5b95c8a653d..46eca31aab0 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.55 1999/02/15 16:46:57 art Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.56 1999/02/26 04:51:17 art Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -60,6 +60,10 @@ #include <vm/vm.h> #include <sys/sysctl.h> +#if defined(UVM) +#include <uvm/uvm_extern.h> +#endif + extern int suid_clear; int usermount = 0; /* sysctl: by default, users may not mount */ @@ -433,7 +437,9 @@ dounmount(mp, flags, p) mp->mnt_flag |= MNT_UNMOUNT; lockmgr(&mp->mnt_lock, LK_DRAIN | LK_INTERLOCK, &mountlist_slock, p); mp->mnt_flag &=~ MNT_ASYNC; +#if !defined(UVM) vnode_pager_umount(mp); /* release cached vnodes */ +#endif cache_purgevfs(mp); /* remove cache entries for this file sys */ if (mp->mnt_syncer != NULL) vgone(mp->mnt_syncer); @@ -495,6 +501,9 @@ sys_sync(p, v, retval) if ((mp->mnt_flag & MNT_RDONLY) == 0) { asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; +#if defined(UVM) + uvm_vnp_sync(mp); +#endif VFS_SYNC(mp, MNT_NOWAIT, p->p_ucred, p); if (asyncflag) mp->mnt_flag |= MNT_ASYNC; @@ -1231,7 +1240,11 @@ sys_unlink(p, v, retval) goto out; } +#if defined(UVM) + (void)uvm_vnp_uncache(vp); +#else (void)vnode_pager_uncache(vp); +#endif VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE); @@ -2073,8 +2086,14 @@ out: VOP_LEASE(tdvp, p, p->p_ucred, LEASE_WRITE); if (fromnd.ni_dvp != tdvp) VOP_LEASE(fromnd.ni_dvp, p, p->p_ucred, LEASE_WRITE); - if (tvp) + if (tvp) { +#if defined(UVM) + (void)uvm_vnp_uncache(tvp); +#else + (void)vnode_pager_uncache(tvp); /* XXX - I think we need this */ +#endif VOP_LEASE(tvp, p, p->p_ucred, LEASE_WRITE); + } error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd, tond.ni_dvp, tond.ni_vp, &tond.ni_cnd); } else { diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 8b7ff95a94a..402af724722 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_vnops.c,v 1.19 1998/12/05 17:16:54 csapuntz Exp $ */ +/* $OpenBSD: vfs_vnops.c,v 1.20 1999/02/26 04:51:17 art Exp $ */ /* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */ /* @@ -56,6 +56,10 @@ #include <vm/vm.h> +#if defined(UVM) +#include <uvm/uvm_extern.h> +#endif + struct fileops vnops = { vn_read, vn_write, vn_ioctl, vn_select, vn_closefile }; @@ -191,8 +195,13 @@ vn_writechk(vp) * the vnode, try to free it up once. If * we fail, we can't allow writing. */ +#if defined(UVM) + if ((vp->v_flag & VTEXT) && !uvm_vnp_uncache(vp)) + return (ETXTBSY); +#else if ((vp->v_flag & VTEXT) && !vnode_pager_uncache(vp)) return (ETXTBSY); +#endif return (0); } |