aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
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 /sys/vm
parentf498eeeeadb12243c0f968c044b3094ef3da2b5c (diff)
Notes
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vnode_pager.c78
-rw-r--r--sys/vm/vnode_pager.h12
2 files changed, 62 insertions, 28 deletions
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_ */