1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

vm_object_madvise:

Support MADV_DONTNEED and MADV_WILLNEED on object types
	besides OBJT_DEFAULT and OBJT_SWAP.

Submitted by:	dillon
This commit is contained in:
Alan Cox 1999-08-12 06:33:56 +00:00
parent a18ff8bea7
commit 58b4e6cc84
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49654

View File

@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_object.c,v 1.161 1999/08/01 06:05:09 alc Exp $
* $Id: vm_object.c,v 1.162 1999/08/09 10:35:05 phk Exp $
*/
/*
@ -766,16 +766,18 @@ vm_object_madvise(object, pindex, count, advise)
tobject = object;
tpindex = pindex;
shadowlookup:
if (tobject->type != OBJT_DEFAULT &&
tobject->type != OBJT_SWAP
) {
continue;
/*
* MADV_FREE only operates on OBJT_DEFAULT or OBJT_SWAP pages
* and those pages must be OBJ_ONEMAPPING.
*/
if (advise == MADV_FREE) {
if ((tobject->type != OBJT_DEFAULT &&
tobject->type != OBJT_SWAP) ||
(tobject->flags & OBJ_ONEMAPPING) == 0) {
continue;
}
}
if ((tobject->flags & OBJ_ONEMAPPING) == 0)
continue;
m = vm_page_lookup(tobject, tpindex);
if (m == NULL) {