summaryrefslogtreecommitdiff
path: root/sys/kern/subr_mbuf.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-03-10 19:39:53 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-03-10 19:39:53 +0000
commitd3c11994e1e3de7445305abd0d41dce2b8d3e6dc (patch)
tree968c512aa3fe86d42039384972c736f2673aa09b /sys/kern/subr_mbuf.c
parent0e8677f68bace0ecfc6b7482cc58b41b230bdd41 (diff)
Notes
Diffstat (limited to 'sys/kern/subr_mbuf.c')
-rw-r--r--sys/kern/subr_mbuf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c
index 7906ab1bdda7..285d376f10b7 100644
--- a/sys/kern/subr_mbuf.c
+++ b/sys/kern/subr_mbuf.c
@@ -614,6 +614,21 @@ mb_alloc(struct mb_lstmngr *mb_list, int how, short type, short persist,
struct mb_bucket *bucket;
void *m;
+/* #ifdef INVARIANTS */
+ int flags;
+
+ flags = how & (M_WAITOK | M_NOWAIT | M_DONTWAIT | M_TRYWAIT);
+ if (flags != M_DONTWAIT && flags != M_TRYWAIT) {
+ static struct timeval lasterr;
+ static int curerr;
+ if (ppsratecheck(&lasterr, &curerr, 1)) {
+ printf("Bad mbuf alloc flags: %x\n", flags);
+ backtrace();
+ how = M_TRYWAIT;
+ }
+ }
+/* #endif */
+
m = NULL;
if ((persist & MBP_PERSISTENT) != 0) {
/*