diff options
-rw-r--r-- | sys/kern/vfs_subr.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 10 |
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); |