diff options
author | dyson <dyson@FreeBSD.org> | 1995-05-07 03:48:54 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1995-05-07 03:48:54 +0000 |
commit | f90d96a223fe07183e66b44fdab345980c7d89a9 (patch) | |
tree | cd3b141baf6e0699bf2fc3df100c8a24c4cc13f2 /sys/vm | |
parent | c1b5993cf895a37502a3b5ae658e2bc90605c080 (diff) | |
download | FreeBSD-src-f90d96a223fe07183e66b44fdab345980c7d89a9.zip FreeBSD-src-f90d96a223fe07183e66b44fdab345980c7d89a9.tar.gz |
Fixed a calculation that would once-in-a-while cause the swap_pager
to emit spurious page outside of object type messages. It is not
a fatal condition anyway, so the message will be omitted for
release. Also, the code that "clips" the allocation size, associated
with the above problem, was fixed.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 9438b13..0a6d839 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 - * $Id: swap_pager.c,v 1.34 1995/04/16 13:58:42 davidg Exp $ + * $Id: swap_pager.c,v 1.35 1995/04/19 10:32:11 davidg Exp $ */ /* @@ -1263,23 +1263,15 @@ swap_pager_output(swp, m, count, flags, rtvals) break; } - ntoget = (i == SWB_NPAGES) ? SWB_NPAGES : 1; /* * this code is alittle conservative, but works (the * intent of this code is to allocate small chunks for * small objects) */ - if (ntoget * PAGE_SIZE > object->size) { - ntoget = (object->size + (PAGE_SIZE - 1)) / PAGE_SIZE; - /* - * make sure that we include the needed page - */ - if (ntoget <= off) { - printf("swap_pager_output: page outside of object -- %d, %d\n", - m[j]->offset, object->size); - ntoget = off + 1; - } + if ((i != 1) && + (foff + ntoget * PAGE_SIZE) > object->size) { + ntoget = ((object->size + (PAGE_SIZE - 1)) - foff) / PAGE_SIZE; } retrygetspace: if (!swap_pager_full && ntoget > 1 && |