From e3c495d003decab12a3fc00167b6b529c501ddb0 Mon Sep 17 00:00:00 2001 From: alc Date: Thu, 12 Aug 1999 06:33:56 +0000 Subject: vm_object_madvise: Support MADV_DONTNEED and MADV_WILLNEED on object types besides OBJT_DEFAULT and OBJT_SWAP. Submitted by: dillon --- sys/vm/vm_object.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 91feed0..70a3def 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -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 @@ relookup: 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) { -- cgit v1.1