mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 23:05:49 +01:00
Fetch an overide for NMBCLUSTERS from the kernel environment. Never allow
the value to be reduced below that defined when the kernel was built.
This commit is contained in:
parent
419766671c
commit
8664a77199
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42705
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.320 1999/01/06 23:05:36 julian Exp $
|
||||
* $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
|
||||
*/
|
||||
|
||||
#include "apm.h"
|
||||
@ -410,6 +410,12 @@ again:
|
||||
*/
|
||||
{
|
||||
vm_offset_t mb_map_size;
|
||||
int xclusters;
|
||||
|
||||
/* Allow override of NMBCLUSTERS from the kernel environment */
|
||||
if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
|
||||
xclusters > nmbclusters)
|
||||
nmbclusters = xclusters;
|
||||
|
||||
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
|
||||
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.320 1999/01/06 23:05:36 julian Exp $
|
||||
* $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
|
||||
*/
|
||||
|
||||
#include "apm.h"
|
||||
@ -410,6 +410,12 @@ again:
|
||||
*/
|
||||
{
|
||||
vm_offset_t mb_map_size;
|
||||
int xclusters;
|
||||
|
||||
/* Allow override of NMBCLUSTERS from the kernel environment */
|
||||
if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
|
||||
xclusters > nmbclusters)
|
||||
nmbclusters = xclusters;
|
||||
|
||||
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
|
||||
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
|
||||
|
Loading…
Reference in New Issue
Block a user