fix the 'size allocated vs. MAXBSIZE' check for buffers. Instead

of making vfs_bio *and* machdep.c deal with it, just deal with it
here, where we actually allocate the physical memory for pages.
This commit is contained in:
cgd 1993-10-18 23:14:13 +00:00
parent 1411cfbd47
commit d7498e64da
1 changed files with 4 additions and 5 deletions

View File

@ -248,13 +248,12 @@ again:
if (vm_map_find(buffer_map, vm_object_allocate(size), (vm_offset_t)0,
&minaddr, size, FALSE) != KERN_SUCCESS)
panic("startup: cannot allocate buffers");
if ((bufpages / nbuf) >= btoc(MAXBSIZE)) {
/* don't want to alloc more physical mem than needed */
bufpages = btoc(MAXBSIZE) * nbuf;
}
base = bufpages / nbuf;
residual = bufpages % nbuf;
if (base >= MAXBSIZE) {
/* don't want to alloc more physical mem than needed */
base = MAXBSIZE;
residual = 0;
}
for (i = 0; i < nbuf; i++) {
vm_size_t curbufsize;
vm_offset_t curbuf;