summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-02-26 04:51:18 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-02-26 04:51:18 +0000
commit52b4d7fbde220c6651b33720adb78ce6728e00b1 (patch)
treeb1934f0b4af62c93bfb43d86689bc1e077bd1598 /sys/kern/vfs_syscalls.c
parentbc8986d97d2f8474b598194a210a6aa5338280b4 (diff)
adaptation to uvm vnode pager
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c23
1 files changed, 21 insertions, 2 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 {