summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-05-03 08:09:24 +0000
committeralc <alc@FreeBSD.org>2003-05-03 08:09:24 +0000
commit410b675ed9777017eff651997cc5bcd53a747cb2 (patch)
tree85f608ce32f6355c4536b30a5b77a77fe27a0668
parent2d603e9073ce8f3d3d5b7159fc89665faf7634d2 (diff)
downloadFreeBSD-src-410b675ed9777017eff651997cc5bcd53a747cb2.zip
FreeBSD-src-410b675ed9777017eff651997cc5bcd53a747cb2.tar.gz
- Revert kern/vfs_subr.c revision 1.444. The vm_object's size isn't
trustworthy for vnode-backed objects. - Restore the old behavior of vm_object_page_remove() when the end of the given range is zero. Add a comment to vm_object_page_remove() regarding this behavior. Reported by: iedowse
-rw-r--r--sys/kern/vfs_subr.c2
-rw-r--r--sys/vm/vm_object.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index ea958ac..e5cd0bb 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1188,7 +1188,7 @@ vinvalbuf(vp, flags, cred, td, slpflag, slptimeo)
*/
if (VOP_GETVOBJECT(vp, &object) == 0) {
VM_OBJECT_LOCK(object);
- vm_object_page_remove(object, 0, object->size,
+ vm_object_page_remove(object, 0, 0,
(flags & V_SAVE) ? TRUE : FALSE);
VM_OBJECT_UNLOCK(object);
}
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index b89cb2c..5a9d7e0 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1675,10 +1675,12 @@ vm_object_collapse(vm_object_t object)
}
/*
- * vm_object_page_remove: [internal]
+ * vm_object_page_remove:
*
- * Removes all physical pages in the specified
- * object range from the object's list of pages.
+ * Removes all physical pages in the given range from the
+ * object's list of pages. If the range's end is zero, all
+ * physical pages from the range's start to the end of the object
+ * are deleted.
*
* The object must be locked.
*/
@@ -1716,7 +1718,7 @@ again:
* or (2) NULL.
*/
for (;
- p != NULL && p->pindex < end;
+ p != NULL && (p->pindex < end || end == 0);
p = next) {
next = TAILQ_NEXT(p, listq);
OpenPOWER on IntegriCloud