Remove a six year old undocumented #ifdef : NO_B_MALLOC.
This commit is contained in:
parent
2a5bcfdef6
commit
e31c615c60
@ -2493,15 +2493,12 @@ allocbuf(struct buf *bp, int size)
|
||||
* mess with B_CACHE.
|
||||
*/
|
||||
mbsize = (size + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
|
||||
#if !defined(NO_B_MALLOC)
|
||||
if (bp->b_flags & B_MALLOC)
|
||||
newbsize = mbsize;
|
||||
else
|
||||
#endif
|
||||
newbsize = round_page(size);
|
||||
|
||||
if (newbsize < bp->b_bufsize) {
|
||||
#if !defined(NO_B_MALLOC)
|
||||
/*
|
||||
* malloced buffers are not shrunk
|
||||
*/
|
||||
@ -2521,13 +2518,11 @@ allocbuf(struct buf *bp, int size)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
vm_hold_free_pages(
|
||||
bp,
|
||||
(vm_offset_t) bp->b_data + newbsize,
|
||||
(vm_offset_t) bp->b_data + bp->b_bufsize);
|
||||
} else if (newbsize > bp->b_bufsize) {
|
||||
#if !defined(NO_B_MALLOC)
|
||||
/*
|
||||
* We only use malloced memory on the first allocation.
|
||||
* and revert to page-allocated memory when the buffer
|
||||
@ -2544,10 +2539,8 @@ allocbuf(struct buf *bp, int size)
|
||||
bufmallocspace += mbsize;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
origbuf = NULL;
|
||||
origbufsize = 0;
|
||||
#if !defined(NO_B_MALLOC)
|
||||
/*
|
||||
* If the buffer is growing on its other-than-first allocation,
|
||||
* then we revert to the page-allocation scheme.
|
||||
@ -2564,17 +2557,14 @@ allocbuf(struct buf *bp, int size)
|
||||
bp->b_flags &= ~B_MALLOC;
|
||||
newbsize = round_page(newbsize);
|
||||
}
|
||||
#endif
|
||||
vm_hold_load_pages(
|
||||
bp,
|
||||
(vm_offset_t) bp->b_data + bp->b_bufsize,
|
||||
(vm_offset_t) bp->b_data + newbsize);
|
||||
#if !defined(NO_B_MALLOC)
|
||||
if (origbuf) {
|
||||
bcopy(origbuf, bp->b_data, origbufsize);
|
||||
free(origbuf, M_BIOBUF);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
vm_page_t m;
|
||||
@ -2584,10 +2574,8 @@ allocbuf(struct buf *bp, int size)
|
||||
desiredpages = (size == 0) ? 0 :
|
||||
num_pages((bp->b_offset & PAGE_MASK) + newbsize);
|
||||
|
||||
#if !defined(NO_B_MALLOC)
|
||||
if (bp->b_flags & B_MALLOC)
|
||||
panic("allocbuf: VMIO buffer can't be malloced");
|
||||
#endif
|
||||
/*
|
||||
* Set B_CACHE initially if buffer is 0 length or will become
|
||||
* 0-length.
|
||||
|
Loading…
Reference in New Issue
Block a user