diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2011-12-02 10:55:47 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2011-12-02 10:55:47 +0000 |
commit | 5e0ffc69ee430c7cac9afd7de3bbb077876af1b3 (patch) | |
tree | 9bce2f47448a598d3ec0e61ba24eeca64f1969df /sys/kern | |
parent | 27c6cf656fa02fc2a05ff7c69214117063583be5 (diff) |
dont put MAXMCLBYTES in the mclsizes array with a comment saying its 64k
when the macro can change without automatically fixing the comment.
instead add a diagnostic that checks that the biggest cluster size is
always MAXMCLBYTES.
requested by and ok kettenis@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 07c70db8c63..4644de7674e 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.164 2011/11/30 10:26:56 dlg Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.165 2011/12/02 10:55:46 dlg Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -108,7 +108,7 @@ u_int mclsizes[] = { 9 * 1024, 12 * 1024, 16 * 1024, - MAXMCLBYTES /* 64k */ + 64 * 1024 }; static char mclnames[MCLPOOLS][8]; struct pool mclpools[MCLPOOLS]; @@ -140,6 +140,11 @@ mbinit(void) { int i; +#if DIAGNOSTIC + if (mclsizes[nitems(mclsizes) - 1] != MAXMCLBYTES) + panic("mbinit: the largest cluster size != MAXMCLBYTES"); +#endif + pool_init(&mbpool, MSIZE, 0, 0, 0, "mbpl", NULL); pool_set_constraints(&mbpool, &kp_dma_contig); pool_setlowat(&mbpool, mblowat); |