diff options
author | alc <alc@FreeBSD.org> | 1999-08-12 06:33:56 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-08-12 06:33:56 +0000 |
commit | e3c495d003decab12a3fc00167b6b529c501ddb0 (patch) | |
tree | b0cc3633cb4cd96551c3e6264b34b22dd626c8eb /sys/vm | |
parent | cf902ddda01f66e310c8be488f0a5f2fc061e758 (diff) | |
download | FreeBSD-src-e3c495d003decab12a3fc00167b6b529c501ddb0.zip FreeBSD-src-e3c495d003decab12a3fc00167b6b529c501ddb0.tar.gz |
vm_object_madvise:
Support MADV_DONTNEED and MADV_WILLNEED on object types
besides OBJT_DEFAULT and OBJT_SWAP.
Submitted by: dillon
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_object.c | 20 |
1 files changed, 11 insertions, 9 deletions
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) { |