summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-02-26 03:22:01 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-02-26 03:22:01 +0000
commitb0067b927db9a5fb07226e49ce0ff2a951c024aa (patch)
treecb6b373bab9955da8e994d92f717a87e488e49e3 /sys/ufs
parent2aedf222cfbb07d94cf6a4aedb7c3c432361b66d (diff)
add compatibility with uvm vnode pagers
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_inode.c12
-rw-r--r--sys/ufs/ext2fs/ext2fs_readwrite.c10
-rw-r--r--sys/ufs/ext2fs/ext2fs_vnops.c6
3 files changed, 25 insertions, 3 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c
index 710a1e52c3a..a0cba46802d 100644
--- a/sys/ufs/ext2fs/ext2fs_inode.c
+++ b/sys/ufs/ext2fs/ext2fs_inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_inode.c,v 1.5 1998/05/18 01:59:16 art Exp $ */
+/* $OpenBSD: ext2fs_inode.c,v 1.6 1999/02/26 03:21:59 art Exp $ */
/* $NetBSD: ext2fs_inode.c,v 1.1 1997/06/11 09:33:56 bouyer Exp $ */
/*
@@ -243,8 +243,13 @@ ext2fs_truncate(v)
if (error)
return (error);
oip->i_e2fs_size = length;
+#if defined(UVM)
+ uvm_vnp_setsize(ovp, length);
+ uvm_vnp_uncache(ovp);
+#else
vnode_pager_setsize(ovp, (u_long)length);
(void) vnode_pager_uncache(ovp);
+#endif
if (aflags & B_SYNC)
bwrite(bp);
else
@@ -272,8 +277,13 @@ ext2fs_truncate(v)
return (error);
oip->i_e2fs_size = length;
size = fs->e2fs_bsize;
+#if defined(UVM)
+ uvm_vnp_setsize(ovp, length);
+ uvm_vnp_uncache(ovp);
+#else
vnode_pager_setsize(ovp, (u_long)length);
(void) vnode_pager_uncache(ovp);
+#endif
bzero((char *)bp->b_data + offset, (u_int)(size - offset));
allocbuf(bp, size);
if (aflags & B_SYNC)
diff --git a/sys/ufs/ext2fs/ext2fs_readwrite.c b/sys/ufs/ext2fs/ext2fs_readwrite.c
index d586f69a3bd..8535646acf4 100644
--- a/sys/ufs/ext2fs/ext2fs_readwrite.c
+++ b/sys/ufs/ext2fs/ext2fs_readwrite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_readwrite.c,v 1.4 1998/03/01 08:07:09 niklas Exp $ */
+/* $OpenBSD: ext2fs_readwrite.c,v 1.5 1999/02/26 03:22:00 art Exp $ */
/* $NetBSD: ext2fs_readwrite.c,v 1.1 1997/06/11 09:34:01 bouyer Exp $ */
/*-
@@ -256,9 +256,17 @@ ext2fs_write(v)
break;
if (uio->uio_offset + xfersize > ip->i_e2fs_size) {
ip->i_e2fs_size = uio->uio_offset + xfersize;
+#if defined(UVM)
+ uvm_vnp_setsize(vp, ip->i_e2fs_size);
+#else
vnode_pager_setsize(vp, (u_long)ip->i_e2fs_size);
+#endif
}
+#if defined(UVM)
+ uvm_vnp_uncache(vp);
+#else
(void)vnode_pager_uncache(vp);
+#endif
size = fs->e2fs_bsize - bp->b_resid;
if (size < xfersize)
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c
index 52ec17a9887..74f14ebffce 100644
--- a/sys/ufs/ext2fs/ext2fs_vnops.c
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vnops.c,v 1.8 1998/08/06 19:35:04 csapuntz Exp $ */
+/* $OpenBSD: ext2fs_vnops.c,v 1.9 1999/02/26 03:22:00 art Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */
/*
@@ -386,7 +386,11 @@ ext2fs_chmod(vp, mode, cred, p)
ip->i_e2fs_mode |= (mode & ALLPERMS);
ip->i_flag |= IN_CHANGE;
if ((vp->v_flag & VTEXT) && (ip->i_e2fs_mode & S_ISTXT) == 0)
+#if defined(UVM)
+ uvm_vnp_uncache(vp);
+#else
(void) vnode_pager_uncache(vp);
+#endif
return (0);
}