From 338f31f581b40d12e472e5c29223dfca09288dc1 Mon Sep 17 00:00:00 2001 From: pk Date: Wed, 5 Feb 2003 21:38:38 +0000 Subject: Make the buffer cache code MP-safe. --- sys/dev/raidframe/rf_netbsdkintf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys/dev/raidframe') diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index a4ab55c2959..aeae2b9712f 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.153 2003/02/01 06:23:40 thorpej Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.154 2003/02/05 21:38:40 pk Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -111,7 +111,7 @@ ***********************************************************/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.153 2003/02/01 06:23:40 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.154 2003/02/05 21:38:40 pk Exp $"); #include #include @@ -1835,6 +1835,12 @@ rf_DispatchKernelIO(queue, req) } #endif raidbp = pool_get(&raidframe_cbufpool, PR_NOWAIT); + if (raidbp == NULL) { + bp->b_flags |= B_ERROR; + bp->b_error = ENOMEM; + return (ENOMEM); + } + simple_lock_init(&raidbp->rf_buf.b_interlock); /* * context for raidiodone -- cgit