Add support for the M_ZERO flag to contigmalloc().

Reviewed by:	jeff
This commit is contained in:
Maxime Henrion 2003-07-25 21:02:25 +00:00
parent 91ae85f3c6
commit b9ff8db1be

View File

@ -222,7 +222,8 @@ contigmalloc1(
m->valid = VM_PAGE_BITS_ALL;
if (m->flags & PG_ZERO)
vm_page_zero_count--;
m->flags = 0;
/* Don't clear the PG_ZERO flag, we'll need it later. */
m->flags &= PG_ZERO;
KASSERT(m->dirty == 0,
("contigmalloc1: page %p was dirty", m));
m->wire_count = 0;
@ -259,6 +260,9 @@ contigmalloc1(
vm_page_t m = &pga[i];
vm_page_insert(m, kernel_object,
OFF_TO_IDX(tmp_addr - VM_MIN_KERNEL_ADDRESS));
if ((flags & M_ZERO) && !(m->flags & PG_ZERO))
bzero((void *)tmp_addr, PAGE_SIZE);
m->flags = 0;
tmp_addr += PAGE_SIZE;
}
VM_OBJECT_UNLOCK(kernel_object);