summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-02-26 03:16:27 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-02-26 03:16:27 +0000
commit39033054ba4c7e768ccdbaea8dfb3e606f691dcc (patch)
tree69f098d5819ce10824bf950ab0af5020775edb19 /sys
parent9c10863399a7470e6e0020dc3d5795ebd321d08c (diff)
compatibility with uvm vnode pager
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_bio.c10
-rw-r--r--sys/nfs/nfs_serv.c10
-rw-r--r--sys/nfs/nfs_subs.c10
-rw-r--r--sys/nfs/nfs_vnops.c22
4 files changed, 48 insertions, 4 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 8543dc08f2b..911ff3522fa 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.14 1997/12/02 16:57:57 csapuntz Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.15 1999/02/26 03:16:25 art Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -467,7 +467,11 @@ nfs_write(v)
/*
* XXX make sure we aren't cached in the VM page cache
*/
+#if defined(UVM)
+ uvm_vnp_uncache(vp);
+#else
(void)vnode_pager_uncache(vp);
+#endif
/*
* Check for a valid write lease.
@@ -510,7 +514,11 @@ again:
np->n_flag |= NMODIFIED;
if (uio->uio_offset + n > np->n_size) {
np->n_size = uio->uio_offset + n;
+#if defined(UVM)
+ uvm_vnp_setsize(vp, (u_long)np->n_size);
+#else
vnode_pager_setsize(vp, (u_long)np->n_size);
+#endif
}
/*
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 1f2934927a4..2320151a993 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_serv.c,v 1.18 1999/02/06 23:07:42 millert Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.19 1999/02/26 03:16:25 art Exp $ */
/* $NetBSD: nfs_serv.c,v 1.25 1996/03/02 15:55:52 jtk Exp $ */
/*
@@ -1658,7 +1658,11 @@ nfsrv_remove(nfsd, slp, procp, mrq)
goto out;
}
if (vp->v_flag & VTEXT)
+#if defined(UVM)
+ uvm_vnp_uncache(vp);
+#else
(void) vnode_pager_uncache(vp);
+#endif
out:
if (!error) {
nqsrv_getl(nd.ni_dvp, ND_WRITE);
@@ -3288,7 +3292,11 @@ nfsrv_access(vp, flags, cred, rdonly, p, override)
* the inode, 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))
+#else
if ((vp->v_flag & VTEXT) && !vnode_pager_uncache(vp))
+#endif
return (ETXTBSY);
}
error = VOP_ACCESS(vp, flags, cred, p);
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 40474abcabe..e6b5c773eca 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.25 1999/02/06 23:07:45 millert Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.26 1999/02/26 03:16:25 art Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -1313,7 +1313,11 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
np->n_size = vap->va_size;
} else
np->n_size = vap->va_size;
+#if defined(UVM)
+ uvm_vnp_setsize(vp, np->n_size);
+#else
vnode_pager_setsize(vp, (u_long)np->n_size);
+#endif
} else
np->n_size = vap->va_size;
}
@@ -1384,7 +1388,11 @@ nfs_getattrcache(vp, vaper)
np->n_size = vap->va_size;
} else
np->n_size = vap->va_size;
+#if defined(UVM)
+ uvm_vnp_setsize(vp, np->n_size);
+#else
vnode_pager_setsize(vp, (u_long)np->n_size);
+#endif
} else
np->n_size = vap->va_size;
}
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index e09bf34e690..667f84e3c73 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.24 1999/02/06 23:07:46 millert Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.25 1999/02/26 03:16:26 art Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -411,7 +411,11 @@ nfs_open(v)
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
ap->a_p, 1)) == EINTR)
return (error);
+#if defined(UVM)
+ uvm_vnp_uncache(vp);
+#else
(void) vnode_pager_uncache(vp);
+#endif
np->n_brev = np->n_lrev;
}
}
@@ -420,7 +424,11 @@ nfs_open(v)
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
ap->a_p, 1)) == EINTR)
return (error);
+#if defined(UVM)
+ uvm_vnp_uncache(vp);
+#else
(void) vnode_pager_uncache(vp);
+#endif
np->n_attrstamp = 0;
if (vp->v_type == VDIR)
np->n_direofoffset = 0;
@@ -438,7 +446,11 @@ nfs_open(v)
if ((error = nfs_vinvalbuf(vp, V_SAVE,
ap->a_cred, ap->a_p, 1)) == EINTR)
return (error);
+#if defined(UVM)
+ uvm_vnp_uncache(vp);
+#else
(void) vnode_pager_uncache(vp);
+#endif
np->n_mtime = vattr.va_mtime.tv_sec;
}
}
@@ -622,7 +634,11 @@ nfs_setattr(v)
return (error);
tsize = np->n_size;
np->n_size = np->n_vattr.va_size = vap->va_size;
+#if defined(UVM)
+ uvm_vnp_setsize(vp, np->n_size);
+#else
vnode_pager_setsize(vp, (u_long)np->n_size);
+#endif
};
} else if ((vap->va_mtime.tv_sec != VNOVAL ||
vap->va_atime.tv_sec != VNOVAL) &&
@@ -633,7 +649,11 @@ nfs_setattr(v)
error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_p);
if (error && vap->va_size != VNOVAL) {
np->n_size = np->n_vattr.va_size = tsize;
+#if defined(UVM)
+ uvm_vnp_setsize(vp, np->n_size);
+#else
vnode_pager_setsize(vp, (u_long)np->n_size);
+#endif
}
return (error);
}