diff options
author | glebius <glebius@FreeBSD.org> | 2013-03-15 10:15:07 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-03-15 10:15:07 +0000 |
commit | 4502cb662c82b7919c3dd6c0616a07f8bc59ca55 (patch) | |
tree | 41c17b986c5fb9e735ace02bc6f85639ebed32ae /sys/kern/uipc_mbuf.c | |
parent | a6da96ea35ca457336acb81ae4e865355d64d5ba (diff) | |
download | FreeBSD-src-4502cb662c82b7919c3dd6c0616a07f8bc59ca55.zip FreeBSD-src-4502cb662c82b7919c3dd6c0616a07f8bc59ca55.tar.gz |
Make m_get2() never use clusters that are bigger than PAGE_SIZE.
Requested by: andre, jhb
Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index e962670..e2b008a 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -92,7 +92,6 @@ m_get2(int size, int how, short type, int flags) { struct mb_args args; struct mbuf *m, *n; - uma_zone_t zone; args.flags = flags; args.type = type; @@ -101,24 +100,15 @@ m_get2(int size, int how, short type, int flags) return (uma_zalloc_arg(zone_mbuf, &args, how)); if (size <= MCLBYTES) return (uma_zalloc_arg(zone_pack, &args, how)); - if (size > MJUM16BYTES) + + if (size > MJUMPAGESIZE) return (NULL); m = uma_zalloc_arg(zone_mbuf, &args, how); if (m == NULL) return (NULL); -#if MJUMPAGESIZE != MCLBYTES - if (size <= MJUMPAGESIZE) - zone = zone_jumbop; - else -#endif - if (size <= MJUM9BYTES) - zone = zone_jumbo9; - else - zone = zone_jumbo16; - - n = uma_zalloc_arg(zone, m, how); + n = uma_zalloc_arg(zone_jumbop, m, how); if (n == NULL) { uma_zfree(zone_mbuf, m); return (NULL); |