When allocating bio's in the swap_pager use M_WAITOK since the

alternative is much worse.
This commit is contained in:
Poul-Henning Kamp 2005-01-03 13:28:56 +00:00
parent 9fd851bb17
commit 4f8205e5d1

View File

@ -2369,18 +2369,19 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp)
bufdone(bp);
return;
}
bio = g_new_bio();
bio = g_alloc_bio();
#if 0
/*
* XXX: We shouldn't really sleep here when we run out of buffers
* XXX: but the alternative is worse right now.
*/
if (bio == NULL) {
/*
* XXX: This is better than panicing, but not much better.
* XXX: Somehow this should be retried. A more generic
* XXX: implementation of ENOMEM in geom may be able to cope.
*/
bp->b_error = ENOMEM;
bp->b_ioflags |= BIO_ERROR;
bufdone(bp);
return;
}
#endif
bio->bio_caller2 = bp;
bio->bio_cmd = bp->b_iocmd;
bio->bio_data = bp->b_data;