Everyone and their dog was using RF_ERRORMSG3 to print out the same
sort of error message, over and over again, in different files. Rather than having the same text repeated in multiple .o files, create a couple of little functions to do the printing, and save a bundle of space. Also improves readability of code.
This commit is contained in:
parent
954775e02c
commit
a2b9142871
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_acctrace.c,v 1.7 2001/11/13 07:11:12 lukem Exp $ */
|
||||
/* $NetBSD: rf_acctrace.c,v 1.8 2002/09/14 17:53:57 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.7 2001/11/13 07:11:12 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.8 2002/09/14 17:53:57 oster Exp $");
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -86,13 +86,11 @@ rf_ConfigureAccessTrace(listp)
|
|||
numTracesSoFar = 0;
|
||||
rc = rf_mutex_init(&rf_tracing_mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
}
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownAccessTrace, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
if (rf_accessTraceBufSize) {
|
||||
RF_Free(access_tracebuf, rf_accessTraceBufSize * sizeof(RF_AccTraceEntry_t));
|
||||
rf_mutex_destroy(&rf_tracing_mutex);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_alloclist.c,v 1.9 2001/11/20 02:37:29 oster Exp $ */
|
||||
/* $NetBSD: rf_alloclist.c,v 1.10 2002/09/14 17:53:57 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -37,7 +37,7 @@
|
|||
***************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.9 2001/11/20 02:37:29 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.10 2002/09/14 17:53:57 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -87,16 +87,14 @@ rf_ConfigureAllocList(listp)
|
|||
|
||||
rc = rf_mutex_init(&alist_mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex( __FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
al_free_list = NULL;
|
||||
fl_hit_count = fl_miss_count = al_free_list_count = 0;
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownAllocList, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown( __FILE__, __LINE__, rc);
|
||||
rf_mutex_destroy(&alist_mutex);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_callback.c,v 1.6 2001/11/13 07:11:12 lukem Exp $ */
|
||||
/* $NetBSD: rf_callback.c,v 1.7 2002/09/14 17:53:59 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.6 2001/11/13 07:11:12 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.7 2002/09/14 17:53:59 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -71,8 +71,7 @@ rf_ConfigureCallback(listp)
|
|||
return (ENOMEM);
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownCallback, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__,__LINE__, rc);
|
||||
rf_ShutdownCallback(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_dagutils.c,v 1.14 2002/08/02 03:32:56 oster Exp $ */
|
||||
/* $NetBSD: rf_dagutils.c,v 1.15 2002/09/14 17:53:59 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.14 2002/08/02 03:32:56 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.15 2002/09/14 17:53:59 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -218,8 +218,7 @@ rf_ConfigureDAGs(listp)
|
|||
return (ENOMEM);
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownDAGs, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownDAGs(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_debugMem.c,v 1.9 2001/11/13 07:11:13 lukem Exp $ */
|
||||
/* $NetBSD: rf_debugMem.c,v 1.10 2002/09/14 17:53:57 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_debugMem.c,v 1.9 2001/11/13 07:11:13 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_debugMem.c,v 1.10 2002/09/14 17:53:57 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -129,8 +129,7 @@ rf_ConfigureDebugMem(listp)
|
|||
|
||||
rc = rf_create_managed_mutex(listp, &rf_debug_mem_mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex( __FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
if (rf_memDebug) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_diskqueue.c,v 1.17 2002/08/02 04:01:51 oster Exp $ */
|
||||
/* $NetBSD: rf_diskqueue.c,v 1.18 2002/09/14 17:53:57 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -66,7 +66,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.17 2002/08/02 04:01:51 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.18 2002/09/14 17:53:57 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -204,14 +204,12 @@ rf_ConfigureDiskQueue(
|
|||
diskqueue->rf_cinfo = &raidPtr->raid_cinfo[r][c];
|
||||
rc = rf_create_managed_mutex(listp, &diskqueue->mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
rc = rf_create_managed_cond(listp, &diskqueue->cond);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
return (0);
|
||||
|
@ -236,8 +234,7 @@ rf_ConfigureDiskQueueSystem(listp)
|
|||
return (ENOMEM);
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownDiskQueueSystem, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown( __FILE__, __LINE__, rc);
|
||||
rf_ShutdownDiskQueueSystem(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_driver.c,v 1.57 2002/09/11 02:22:49 oster Exp $ */
|
||||
/* $NetBSD: rf_driver.c,v 1.58 2002/09/14 17:53:58 oster Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
|
@ -73,7 +73,7 @@
|
|||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.57 2002/09/11 02:22:49 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.58 2002/09/14 17:53:58 oster Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -173,8 +173,7 @@ rf_BootRaidframe()
|
|||
|
||||
rc = rf_lkmgr_mutex_init(&configureMutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex( __FILE__, __LINE__, rc);
|
||||
RF_PANIC();
|
||||
}
|
||||
configureCount = 0;
|
||||
|
@ -317,8 +316,7 @@ rf_Shutdown(raidPtr)
|
|||
#define DO_RAID_MUTEX(_m_) { \
|
||||
rc = rf_create_managed_mutex(&raidPtr->shutdownList, (_m_)); \
|
||||
if (rc) { \
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", \
|
||||
__FILE__, __LINE__, rc); \
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc); \
|
||||
DO_RAID_FAIL(); \
|
||||
return(rc); \
|
||||
} \
|
||||
|
@ -327,8 +325,7 @@ rf_Shutdown(raidPtr)
|
|||
#define DO_RAID_COND(_c_) { \
|
||||
rc = rf_create_managed_cond(&raidPtr->shutdownList, (_c_)); \
|
||||
if (rc) { \
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n", \
|
||||
__FILE__, __LINE__, rc); \
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc); \
|
||||
DO_RAID_FAIL(); \
|
||||
return(rc); \
|
||||
} \
|
||||
|
@ -348,8 +345,7 @@ rf_Configure(raidPtr, cfgPtr, ac)
|
|||
if (isconfigged == 0) {
|
||||
rc = rf_create_managed_mutex(&globalShutdown, &rf_printf_mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownList(&globalShutdown);
|
||||
return (rc);
|
||||
}
|
||||
|
@ -393,8 +389,7 @@ rf_Configure(raidPtr, cfgPtr, ac)
|
|||
(void (*) (void *)) rf_FreeAllocList,
|
||||
raidPtr->cleanupList);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
DO_RAID_FAIL();
|
||||
return (rc);
|
||||
}
|
||||
|
@ -516,14 +511,12 @@ init_rad(desc)
|
|||
|
||||
rc = rf_mutex_init(&desc->mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
rc = rf_cond_init(&desc->cond);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
rf_mutex_destroy(&desc->mutex);
|
||||
return (rc);
|
||||
}
|
||||
|
@ -558,8 +551,7 @@ rf_ConfigureRDFreeList(listp)
|
|||
}
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownRDFreeList, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownRDFreeList(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
@ -892,8 +884,7 @@ rf_InitThroughputStats(
|
|||
/* these used by user-level raidframe only */
|
||||
rc = rf_create_managed_mutex(listp, &raidPtr->throughputstats.mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
raidPtr->throughputstats.sum_io_us = 0;
|
||||
|
@ -1017,3 +1008,33 @@ rf_print_assert_panic_message(line,file,condition)
|
|||
"raidframe error at line %d file %s (failed asserting %s)\n",
|
||||
line, file, condition);
|
||||
}
|
||||
|
||||
void
|
||||
rf_print_unable_to_init_mutex(file,line,rc)
|
||||
char *file;
|
||||
int line;
|
||||
int rc;
|
||||
{
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n",
|
||||
file, line, rc);
|
||||
}
|
||||
|
||||
void
|
||||
rf_print_unable_to_init_cond(file,line,rc)
|
||||
char *file;
|
||||
int line;
|
||||
int rc;
|
||||
{
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n",
|
||||
file, line, rc);
|
||||
}
|
||||
|
||||
void
|
||||
rf_print_unable_to_add_shutdown(file,line,rc)
|
||||
char *file;
|
||||
int line;
|
||||
int rc;
|
||||
{
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
file, line, rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_engine.c,v 1.15 2002/07/14 03:04:02 oster Exp $ */
|
||||
/* $NetBSD: rf_engine.c,v 1.16 2002/09/14 17:53:59 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -55,7 +55,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.15 2002/07/14 03:04:02 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.16 2002/09/14 17:53:59 oster Exp $");
|
||||
|
||||
#include "rf_threadstuff.h"
|
||||
|
||||
|
@ -163,8 +163,7 @@ rf_ConfigureEngine(
|
|||
}
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownEngine, raidPtr);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownEngine(NULL);
|
||||
}
|
||||
return (rc);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_general.h,v 1.9 2001/10/04 15:58:53 oster Exp $ */
|
||||
/* $NetBSD: rf_general.h,v 1.10 2002/09/14 17:53:57 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -50,7 +50,11 @@
|
|||
|
||||
void rf_print_panic_message(int, char *);
|
||||
void rf_print_assert_panic_message(int, char *, char *);
|
||||
void rf_print_unable_to_init_mutex(char *, int, int);
|
||||
void rf_print_unable_to_init_cond(char *, int, int);
|
||||
void rf_print_unable_to_add_shutdown(char *, int, int);
|
||||
|
||||
|
||||
extern char rf_panicbuf[];
|
||||
#define RF_PANIC() {rf_print_panic_message(__LINE__,__FILE__); panic(rf_panicbuf);}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_map.c,v 1.13 2002/08/03 01:06:48 oster Exp $ */
|
||||
/* $NetBSD: rf_map.c,v 1.14 2002/09/14 17:53:59 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
**************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.13 2002/08/03 01:06:48 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.14 2002/09/14 17:53:59 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -354,8 +354,7 @@ rf_ConfigureMapModule(listp)
|
|||
}
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownMapModule, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownMapModule(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_mcpair.c,v 1.7 2001/11/13 07:11:14 lukem Exp $ */
|
||||
/* $NetBSD: rf_mcpair.c,v 1.8 2002/09/14 17:53:58 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.7 2001/11/13 07:11:14 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.8 2002/09/14 17:53:58 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -65,14 +65,12 @@ init_mcpair(t)
|
|||
|
||||
rc = rf_mutex_init(&t->mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
rc = rf_cond_init(&t->cond);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
rf_mutex_destroy(&t->mutex);
|
||||
return (rc);
|
||||
}
|
||||
|
@ -104,8 +102,7 @@ rf_ConfigureMCPair(listp)
|
|||
RF_MCPAIR_INC, sizeof(RF_MCPair_t));
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownMCPair, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownMCPair(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_paritylog.c,v 1.8 2002/05/22 15:40:51 wiz Exp $ */
|
||||
/* $NetBSD: rf_paritylog.c,v 1.9 2002/09/14 17:53:58 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_paritylog.c,v 1.8 2002/05/22 15:40:51 wiz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_paritylog.c,v 1.9 2002/09/14 17:53:58 oster Exp $");
|
||||
|
||||
#include "rf_archs.h"
|
||||
|
||||
|
@ -78,8 +78,7 @@ AllocParityLogCommonData(RF_Raid_t * raidPtr)
|
|||
RF_Malloc(common, sizeof(RF_CommonLogData_t), (RF_CommonLogData_t *));
|
||||
rc = rf_mutex_init(&common->mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
RF_Free(common, sizeof(RF_CommonLogData_t));
|
||||
common = NULL;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_paritylogging.c,v 1.12 2001/11/13 07:11:15 lukem Exp $ */
|
||||
/* $NetBSD: rf_paritylogging.c,v 1.13 2002/09/14 17:53:58 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.12 2001/11/13 07:11:15 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.13 2002/09/14 17:53:58 oster Exp $");
|
||||
|
||||
#include "rf_archs.h"
|
||||
|
||||
|
@ -240,8 +240,7 @@ rf_ConfigureParityLogging(
|
|||
lHeapPtr = raidPtr->parityLogBufferHeap;
|
||||
rc = rf_mutex_init(&raidPtr->parityLogPool.mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
RF_Free(raidPtr->parityLogBufferHeap, raidPtr->numParityLogs *
|
||||
raidPtr->numSectorsPerLog * raidPtr->bytesPerSector);
|
||||
return (ENOMEM);
|
||||
|
@ -312,14 +311,12 @@ rf_ConfigureParityLogging(
|
|||
/* build pool of region buffers */
|
||||
rc = rf_mutex_init(&raidPtr->regionBufferPool.mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (ENOMEM);
|
||||
}
|
||||
rc = rf_cond_init(&raidPtr->regionBufferPool.cond);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
rf_mutex_destroy(&raidPtr->regionBufferPool.mutex);
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
@ -382,14 +379,12 @@ rf_ConfigureParityLogging(
|
|||
parityBufferCapacity = maxRegionParityRange;
|
||||
rc = rf_mutex_init(&raidPtr->parityBufferPool.mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
rc = rf_cond_init(&raidPtr->parityBufferPool.cond);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
rf_mutex_destroy(&raidPtr->parityBufferPool.mutex);
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
@ -453,14 +448,12 @@ rf_ConfigureParityLogging(
|
|||
rc = rf_create_managed_mutex(listp,
|
||||
&raidPtr->parityLogDiskQueue.mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
rc = rf_create_managed_cond(listp, &raidPtr->parityLogDiskQueue.cond);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
raidPtr->parityLogDiskQueue.flushQueue = NULL;
|
||||
|
@ -487,8 +480,7 @@ rf_ConfigureParityLogging(
|
|||
for (i = 0; i < rf_numParityRegions; i++) {
|
||||
rc = rf_mutex_init(&raidPtr->regionInfo[i].mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
for (j = 0; j < i; j++)
|
||||
FreeRegionInfo(raidPtr, j);
|
||||
RF_Free(raidPtr->regionInfo,
|
||||
|
@ -498,8 +490,7 @@ rf_ConfigureParityLogging(
|
|||
}
|
||||
rc = rf_mutex_init(&raidPtr->regionInfo[i].reintMutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
rf_mutex_destroy(&raidPtr->regionInfo[i].mutex);
|
||||
for (j = 0; j < i; j++)
|
||||
FreeRegionInfo(raidPtr, j);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_psstatus.c,v 1.8 2001/11/13 07:11:16 lukem Exp $ */
|
||||
/* $NetBSD: rf_psstatus.c,v 1.9 2002/09/14 17:53:58 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.8 2001/11/13 07:11:16 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.9 2002/09/14 17:53:58 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -107,8 +107,7 @@ rf_ConfigurePSStatus(
|
|||
return (ENOMEM);
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownPSStatus, raidPtr);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownPSStatus(raidPtr);
|
||||
return (rc);
|
||||
}
|
||||
|
@ -132,8 +131,7 @@ rf_MakeParityStripeStatusTable(raidPtr)
|
|||
for (i = 0; i < raidPtr->pssTableSize; i++) {
|
||||
rc = rf_mutex_init(&pssTable[i].mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
/* fail and deallocate */
|
||||
for (j = 0; j < i; j++) {
|
||||
rf_mutex_destroy(&pssTable[i].mutex);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_reconmap.c,v 1.8 2001/11/13 07:11:16 lukem Exp $ */
|
||||
/* $NetBSD: rf_reconmap.c,v 1.9 2002/09/14 17:53:58 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -34,7 +34,7 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.8 2001/11/13 07:11:16 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.9 2002/09/14 17:53:58 oster Exp $");
|
||||
|
||||
#include "rf_raid.h"
|
||||
#include <sys/time.h>
|
||||
|
@ -107,8 +107,7 @@ rf_MakeReconMap(raidPtr, ru_sectors, disk_sectors, spareUnitsPerDisk)
|
|||
|
||||
rc = rf_mutex_init(&p->mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
RF_Free(p->status, num_rus * sizeof(RF_ReconMapListElem_t *));
|
||||
RF_Free(p, sizeof(RF_ReconMap_t));
|
||||
return (NULL);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_reconstruct.c,v 1.35 2002/09/09 02:44:17 oster Exp $ */
|
||||
/* $NetBSD: rf_reconstruct.c,v 1.36 2002/09/14 17:53:59 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.35 2002/09/09 02:44:17 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.36 2002/09/14 17:53:59 oster Exp $");
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sys/buf.h>
|
||||
|
@ -55,9 +55,9 @@ __KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.35 2002/09/09 02:44:17 oster Ex
|
|||
#include "rf_etimer.h"
|
||||
#include "rf_dag.h"
|
||||
#include "rf_desc.h"
|
||||
#include "rf_debugprint.h"
|
||||
#include "rf_general.h"
|
||||
#include "rf_freelist.h"
|
||||
#include "rf_debugprint.h"
|
||||
#include "rf_driver.h"
|
||||
#include "rf_utils.h"
|
||||
#include "rf_shutdown.h"
|
||||
|
@ -215,8 +215,7 @@ rf_ConfigureReconstruction(listp)
|
|||
}
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownReconstruction, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownReconstruction(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_reconutil.c,v 1.5 2001/11/13 07:11:16 lukem Exp $ */
|
||||
/* $NetBSD: rf_reconutil.c,v 1.6 2002/09/14 17:53:58 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -31,7 +31,7 @@
|
|||
********************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.5 2001/11/13 07:11:16 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.6 2002/09/14 17:53:58 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -121,15 +121,13 @@ rf_MakeReconControl(reconDesc, frow, fcol, srow, scol)
|
|||
rc = rf_mutex_init(&reconCtrlPtr->eq_mutex);
|
||||
if (rc) {
|
||||
/* XXX deallocate, cleanup */
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (NULL);
|
||||
}
|
||||
rc = rf_cond_init(&reconCtrlPtr->eq_cond);
|
||||
if (rc) {
|
||||
/* XXX deallocate, cleanup */
|
||||
RF_ERRORMSG3("Unable to init cond file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
return (NULL);
|
||||
}
|
||||
reconCtrlPtr->eventQueue = NULL;
|
||||
|
@ -139,8 +137,7 @@ rf_MakeReconControl(reconDesc, frow, fcol, srow, scol)
|
|||
rc = rf_mutex_init(&reconCtrlPtr->rb_mutex);
|
||||
if (rc) {
|
||||
/* XXX deallocate, cleanup */
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (NULL);
|
||||
}
|
||||
reconCtrlPtr->fullBufferList = NULL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_revent.c,v 1.10 2001/11/13 07:11:16 lukem Exp $ */
|
||||
/* $NetBSD: rf_revent.c,v 1.11 2002/09/14 17:54:00 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.10 2001/11/13 07:11:16 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.11 2002/09/14 17:54:00 oster Exp $");
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
|
@ -83,8 +83,7 @@ rf_ConfigureReconEvent(listp)
|
|||
return (ENOMEM);
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownReconEvent, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownReconEvent(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_stripelocks.c,v 1.13 2002/09/11 02:52:33 oster Exp $ */
|
||||
/* $NetBSD: rf_stripelocks.c,v 1.14 2002/09/14 17:53:59 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -57,7 +57,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.13 2002/09/11 02:52:33 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.14 2002/09/14 17:53:59 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -157,8 +157,7 @@ rf_ConfigureStripeLockFreeList(listp)
|
|||
RF_STRIPELOCK_INITIAL, sizeof(RF_StripeLockDesc_t));
|
||||
rc = rf_ShutdownCreate(listp, rf_ShutdownStripeLockFreeList, NULL);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownStripeLockFreeList(NULL);
|
||||
return (rc);
|
||||
}
|
||||
|
@ -186,8 +185,7 @@ rf_MakeLockTable()
|
|||
for (i = 0; i < rf_lockTableSize; i++) {
|
||||
rc = rf_mutex_init(&lockTable[i].mutex);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
|
||||
__LINE__, rc);
|
||||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
/* XXX clean up other mutexes */
|
||||
return (NULL);
|
||||
}
|
||||
|
@ -232,8 +230,7 @@ rf_ConfigureStripeLocks(
|
|||
return (ENOMEM);
|
||||
rc = rf_ShutdownCreate(listp, rf_RaidShutdownStripeLocks, raidPtr);
|
||||
if (rc) {
|
||||
RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
|
||||
__FILE__, __LINE__, rc);
|
||||
rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
|
||||
rf_ShutdownStripeLocks(raidPtr->lockTable);
|
||||
return (rc);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue