diff options
Diffstat (limited to 'freebsd/sys/kern/kern_mbuf.c')
-rw-r--r-- | freebsd/sys/kern/kern_mbuf.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/freebsd/sys/kern/kern_mbuf.c b/freebsd/sys/kern/kern_mbuf.c index 09cae9b2..f94eda5b 100644 --- a/freebsd/sys/kern/kern_mbuf.c +++ b/freebsd/sys/kern/kern_mbuf.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/conf.h> +#include <sys/domainset.h> #include <sys/malloc.h> #include <sys/systm.h> #include <sys/mbuf.h> @@ -423,8 +424,6 @@ nd_buf_import(void *arg, void **store, int count, int domain __unused, struct mbuf *m; int i; - KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__)); - q = arg; for (i = 0; i < count; i++) { @@ -434,6 +433,8 @@ nd_buf_import(void *arg, void **store, int count, int domain __unused, trash_init(m, q == &nd_mbufq ? MSIZE : nd_clsize, flags); store[i] = m; } + KASSERT((flags & M_WAITOK) == 0 || i == count, + ("%s: ran out of pre-allocated mbufs", __func__)); return (i); } @@ -460,8 +461,6 @@ nd_pack_import(void *arg __unused, void **store, int count, int domain __unused, void *clust; int i; - KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__)); - for (i = 0; i < count; i++) { m = m_get(MT_DATA, M_NOWAIT); if (m == NULL) @@ -474,6 +473,8 @@ nd_pack_import(void *arg __unused, void **store, int count, int domain __unused, mb_ctor_clust(clust, nd_clsize, m, 0); store[i] = m; } + KASSERT((flags & M_WAITOK) == 0 || i == count, + ("%s: ran out of pre-allocated mbufs", __func__)); return (i); } @@ -605,8 +606,9 @@ mbuf_jumbo_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *flags, /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; #ifndef __rtems__ - return ((void *)kmem_alloc_contig_domain(domain, bytes, wait, - (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT)); + return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), + bytes, wait, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, + VM_MEMATTR_DEFAULT)); #else /* __rtems__ */ return ((void *)malloc(bytes, M_TEMP, wait)); #endif /* __rtems__ */ |