aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>1998-02-26 06:39:59 +0000
committerMike Smith <msmith@FreeBSD.org>1998-02-26 06:39:59 +0000
commitce75f2c365a32572982d8e77ee0405f5b2bd7d8d (patch)
tree56102c3309d82a0355a2a85e05b3410912007808
parentf498eeeeadb12243c0f968c044b3094ef3da2b5c (diff)
Notes
-rw-r--r--sys/ufs/ffs/ffs_vnops.c4
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c16
-rw-r--r--sys/vm/vnode_pager.c78
-rw-r--r--sys/vm/vnode_pager.h12
4 files changed, 80 insertions, 30 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 522f08911348..0210d61458ee 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95
- * $Id: ffs_vnops.c,v 1.41 1998/02/04 22:33:33 eivind Exp $
+ * $Id: ffs_vnops.c,v 1.42 1998/02/06 12:14:16 eivind Exp $
*/
#include <sys/param.h>
@@ -62,6 +62,7 @@
static int ffs_fsync __P((struct vop_fsync_args *));
static int ffs_getpages __P((struct vop_getpages_args *));
+static int ffs_putpages __P((struct vop_putpages_args *));
static int ffs_read __P((struct vop_read_args *));
static int ffs_write __P((struct vop_write_args *));
@@ -71,6 +72,7 @@ static struct vnodeopv_entry_desc ffs_vnodeop_entries[] = {
{ &vop_default_desc, (vop_t *) ufs_vnoperate },
{ &vop_fsync_desc, (vop_t *) ffs_fsync },
{ &vop_getpages_desc, (vop_t *) ffs_getpages },
+ { &vop_putpages_desc, (vop_t *) ffs_putpages },
{ &vop_read_desc, (vop_t *) ffs_read },
{ &vop_reallocblks_desc, (vop_t *) ffs_reallocblks },
{ &vop_write_desc, (vop_t *) ffs_write },
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index 3996692396bc..19f72804314e 100644
--- a/sys/ufs/ufs/ufs_readwrite.c
+++ b/sys/ufs/ufs/ufs_readwrite.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95
- * $Id: ufs_readwrite.c,v 1.41 1998/01/30 11:34:05 phk Exp $
+ * $Id: ufs_readwrite.c,v 1.42 1998/02/05 03:32:33 dyson Exp $
*/
#define BLKSIZE(a, b, c) blksize(a, b, c)
@@ -539,3 +539,17 @@ ffs_getpages(ap)
return (rtval);
}
+
+/*
+ * put page routine
+ *
+ * XXX By default, wimp out... note that a_offset is ignored (and always
+ * XXX has been).
+ */
+int
+ffs_putpages(ap)
+ struct vop_putpages_args *ap;
+{
+ return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count,
+ ap->a_sync, ap->a_rtvals);
+}
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 98b57b04bf0c..ae934c1c35cd 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
- * $Id: vnode_pager.c,v 1.85 1998/02/23 08:22:48 dyson Exp $
+ * $Id: vnode_pager.c,v 1.86 1998/02/25 03:55:53 dyson Exp $
*/
/*
@@ -88,11 +88,6 @@ struct pagerops vnodepagerops = {
NULL
};
-static int vnode_pager_leaf_getpages __P((vm_object_t object, vm_page_t *m,
- int count, int reqpage));
-static int vnode_pager_leaf_putpages __P((vm_object_t object, vm_page_t *m,
- int count, boolean_t sync,
- int *rtvals));
/*
* Allocate (or lookup) pager for a vnode.
@@ -519,6 +514,14 @@ vnode_pager_input_old(object, m)
* generic vnode pager input routine
*/
+/*
+ * EOPNOTSUPP is no longer legal. For local media VFS's that do not
+ * implement their own VOP_GETPAGES, their VOP_GETPAGES should call to
+ * vnode_pager_generic_getpages() to implement the previous behaviour.
+ *
+ * All other FS's should use the bypass to get to the local media
+ * backing vp's VOP_GETPAGES.
+ */
static int
vnode_pager_getpages(object, m, count, reqpage)
vm_object_t object;
@@ -530,31 +533,43 @@ vnode_pager_getpages(object, m, count, reqpage)
struct vnode *vp;
vp = object->handle;
+ /*
+ * XXX temporary diagnostic message to help track stale FS code,
+ * Returning EOPNOTSUPP from here may make things unhappy.
+ */
rtval = VOP_GETPAGES(vp, m, count*PAGE_SIZE, reqpage, 0);
if (rtval == EOPNOTSUPP)
- return vnode_pager_leaf_getpages(object, m, count, reqpage);
- else
- return rtval;
+ printf("vnode_pager: *** WARNING *** stale FS code in system.\n");
+ return rtval;
}
-static int
-vnode_pager_leaf_getpages(object, m, count, reqpage)
- vm_object_t object;
+
+/*
+ * This is now called from local media FS's to operate against their
+ * own vnodes if they fail to implement VOP_GETPAGES.
+ */
+int
+vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
+ struct vnode *vp;
vm_page_t *m;
- int count;
+ int bytecount;
int reqpage;
{
+ vm_object_t object;
vm_offset_t kva;
off_t foff;
int i, size, bsize, first, firstaddr;
- struct vnode *dp, *vp;
+ struct vnode *dp;
int runpg;
int runend;
struct buf *bp;
int s;
+ int count;
int error = 0;
- vp = object->handle;
+ object = vp->v_object;
+ count = bytecount / PAGE_SIZE;
+
if (vp->v_mount == NULL)
return VM_PAGER_BAD;
@@ -770,6 +785,14 @@ vnode_pager_leaf_getpages(object, m, count, reqpage)
return (error ? VM_PAGER_ERROR : VM_PAGER_OK);
}
+/*
+ * EOPNOTSUPP is no longer legal. For local media VFS's that do not
+ * implement their own VOP_PUTPAGES, their VOP_PUTPAGES should call to
+ * vnode_pager_generic_putpages() to implement the previous behaviour.
+ *
+ * All other FS's should use the bypass to get to the local media
+ * backing vp's VOP_PUTPAGES.
+ */
static int
vnode_pager_putpages(object, m, count, sync, rtvals)
vm_object_t object;
@@ -782,34 +805,35 @@ vnode_pager_putpages(object, m, count, sync, rtvals)
struct vnode *vp;
vp = object->handle;
- rtval = VOP_PUTPAGES(vp, m, count*PAGE_SIZE, sync, rtvals, 0);
- if (rtval == EOPNOTSUPP)
- return vnode_pager_leaf_putpages(object, m, count, sync, rtvals);
- else
- return rtval;
+ return VOP_PUTPAGES(vp, m, count*PAGE_SIZE, sync, rtvals, 0);
}
+
/*
- * generic vnode pager output routine
+ * This is now called from local media FS's to operate against their
+ * own vnodes if they fail to implement VOP_GETPAGES.
*/
-static int
-vnode_pager_leaf_putpages(object, m, count, sync, rtvals)
- vm_object_t object;
+int
+vnode_pager_generic_putpages(vp, m, bytecount, sync, rtvals)
+ struct vnode *vp;
vm_page_t *m;
- int count;
+ int bytecount;
boolean_t sync;
int *rtvals;
{
int i;
+ vm_object_t object;
+ int count;
- struct vnode *vp;
int maxsize, ncount;
vm_ooffset_t poffset;
struct uio auio;
struct iovec aiov;
int error;
- vp = object->handle;;
+ object = vp->v_object;
+ count = bytecount / PAGE_SIZE;
+
for (i = 0; i < count; i++)
rtvals[i] = VM_PAGER_AGAIN;
diff --git a/sys/vm/vnode_pager.h b/sys/vm/vnode_pager.h
index c7a0c9be34b0..4402e14723cf 100644
--- a/sys/vm/vnode_pager.h
+++ b/sys/vm/vnode_pager.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vnode_pager.h 8.1 (Berkeley) 6/11/93
- * $Id$
+ * $Id: vnode_pager.h,v 1.10 1997/02/22 09:48:43 peter Exp $
*/
#ifndef _VNODE_PAGER_
@@ -46,6 +46,16 @@
vm_object_t vnode_pager_alloc __P((void *, vm_size_t, vm_prot_t, vm_ooffset_t));
void vnode_pager_freepage __P((vm_page_t m));
struct vnode *vnode_pager_lock __P((vm_object_t));
+
+/*
+ * XXX Generic routines; currently called by badly written FS code; these
+ * XXX should go away soon.
+ */
+int vnode_pager_generic_getpages __P((struct vnode *vp, vm_page_t *m,
+ int count, int reqpage));
+int vnode_pager_generic_putpages __P((struct vnode *vp, vm_page_t *m,
+ int count, boolean_t sync,
+ int *rtvals));
#endif
#endif /* _VNODE_PAGER_ */