From a7576e2e4b38781dbae543125ce5e5a8d43b4ff2 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Wed, 5 Mar 2003 14:48:28 +0000 Subject: [PATCH] Back out last commit, which is fine in theory, but ignores the fact that a lock is held whilst the allocations are made (M_WAITOK -> M_NOWAIT). --- sys/dev/sound/pcm/feeder.c | 6 +++--- sys/dev/sound/pcm/feeder_fmt.c | 6 +++--- sys/dev/sound/pcm/feeder_rate.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index 851957439a35..0c2f7847cefe 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -59,7 +59,7 @@ feeder_register(void *p) KASSERT(fc->desc == NULL, ("first feeder not root: %s", fc->name)); SLIST_INIT(&feedertab); - fte = malloc(sizeof(*fte), M_FEEDER, M_WAITOK | M_ZERO); + fte = malloc(sizeof(*fte), M_FEEDER, M_NOWAIT | M_ZERO); if (fte == NULL) { printf("can't allocate memory for root feeder: %s\n", fc->name); @@ -84,7 +84,7 @@ feeder_register(void *p) i = 0; while ((feedercnt < MAXFEEDERS) && (fc->desc[i].type > 0)) { /* printf("adding feeder %s, %x -> %x\n", fc->name, fc->desc[i].in, fc->desc[i].out); */ - fte = malloc(sizeof(*fte), M_FEEDER, M_WAITOK | M_ZERO); + fte = malloc(sizeof(*fte), M_FEEDER, M_NOWAIT | M_ZERO); if (fte == NULL) { printf("can't allocate memory for feeder '%s', %x -> %x\n", fc->name, fc->desc[i].in, fc->desc[i].out); @@ -137,7 +137,7 @@ feeder_create(struct feeder_class *fc, struct pcm_feederdesc *desc) struct pcm_feeder *f; int err; - f = (struct pcm_feeder *)kobj_create((kobj_class_t)fc, M_FEEDER, M_WAITOK | M_ZERO); + f = (struct pcm_feeder *)kobj_create((kobj_class_t)fc, M_FEEDER, M_NOWAIT | M_ZERO); if (f == NULL) return NULL; diff --git a/sys/dev/sound/pcm/feeder_fmt.c b/sys/dev/sound/pcm/feeder_fmt.c index 72de901318cc..9306af2d3285 100644 --- a/sys/dev/sound/pcm/feeder_fmt.c +++ b/sys/dev/sound/pcm/feeder_fmt.c @@ -209,7 +209,7 @@ FEEDER_DECLARE(feeder_8to16le, 0, NULL); static int feed_16to8_init(struct pcm_feeder *f) { - f->data = malloc(FEEDBUFSZ, M_FMTFEEDER, M_WAITOK | M_ZERO); + f->data = malloc(FEEDBUFSZ, M_FMTFEEDER, M_NOWAIT | M_ZERO); return 0; } @@ -318,7 +318,7 @@ FEEDER_DECLARE(feeder_monotostereo16, 0, NULL); static int feed_stereotomono8_init(struct pcm_feeder *f) { - f->data = malloc(FEEDBUFSZ, M_FMTFEEDER, M_WAITOK | M_ZERO); + f->data = malloc(FEEDBUFSZ, M_FMTFEEDER, M_NOWAIT | M_ZERO); return 0; } @@ -363,7 +363,7 @@ FEEDER_DECLARE(feeder_stereotomono8, 1, NULL); static int feed_stereotomono16_init(struct pcm_feeder *f) { - f->data = malloc(FEEDBUFSZ, M_FMTFEEDER, M_WAITOK | M_ZERO); + f->data = malloc(FEEDBUFSZ, M_FMTFEEDER, M_NOWAIT | M_ZERO); return 0; } diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index 4dfff2ef64c1..540ff979ede1 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -249,7 +249,7 @@ feed_rate_init(struct pcm_feeder *f) { struct feed_rate_info *info; - info = malloc(sizeof(*info), M_RATEFEEDER, M_WAITOK | M_ZERO); + info = malloc(sizeof(*info), M_RATEFEEDER, M_NOWAIT | M_ZERO); info->src = DSP_DEFAULT_SPEED; info->dst = DSP_DEFAULT_SPEED; info->channels = 2;