cond_destroyer joins mutex_destroyer in the "nothing useful is done
here" department. remove _rf_init_threadgroup() and rf_destroy_threadgroup() which were already #if 0'ed. rf_cond_destroy() does nothing. Nuke it, and all callers. rf_cond_init() doesn't deserve to be a separate function any more. Fix up the remaining 3 callers, and nuke rf_cond_init(). Another 0.4K goes "poof", but still no functionality lost!
This commit is contained in:
parent
c629932636
commit
2f4066f82e
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_paritylogging.c,v 1.19 2003/12/29 05:22:16 oster Exp $ */
|
||||
/* $NetBSD: rf_paritylogging.c,v 1.20 2003/12/29 05:36:19 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.19 2003/12/29 05:22:16 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.20 2003/12/29 05:36:19 oster Exp $");
|
||||
|
||||
#include "rf_archs.h"
|
||||
|
||||
|
@ -310,11 +310,7 @@ rf_ConfigureParityLogging(
|
|||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (ENOMEM);
|
||||
}
|
||||
rc = rf_cond_init(&raidPtr->regionBufferPool.cond);
|
||||
if (rc) {
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
return (ENOMEM);
|
||||
}
|
||||
raidPtr->regionBufferPool.cond = 0;
|
||||
raidPtr->regionBufferPool.bufferSize = raidPtr->regionLogCapacity *
|
||||
raidPtr->bytesPerSector;
|
||||
printf("regionBufferPool.bufferSize %d\n",
|
||||
|
@ -334,7 +330,6 @@ rf_ConfigureParityLogging(
|
|||
raidPtr->regionBufferPool.totalBuffers * sizeof(caddr_t),
|
||||
(caddr_t *));
|
||||
if (raidPtr->regionBufferPool.buffers == NULL) {
|
||||
rf_cond_destroy(&raidPtr->regionBufferPool.cond);
|
||||
return (ENOMEM);
|
||||
}
|
||||
for (i = 0; i < raidPtr->regionBufferPool.totalBuffers; i++) {
|
||||
|
@ -345,7 +340,6 @@ rf_ConfigureParityLogging(
|
|||
raidPtr->regionBufferPool.bufferSize * sizeof(char),
|
||||
(caddr_t));
|
||||
if (raidPtr->regionBufferPool.buffers[i] == NULL) {
|
||||
rf_cond_destroy(&raidPtr->regionBufferPool.cond);
|
||||
for (j = 0; j < i; j++) {
|
||||
RF_Free(raidPtr->regionBufferPool.buffers[i],
|
||||
raidPtr->regionBufferPool.bufferSize *
|
||||
|
@ -375,11 +369,7 @@ rf_ConfigureParityLogging(
|
|||
rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
|
||||
return (rc);
|
||||
}
|
||||
rc = rf_cond_init(&raidPtr->parityBufferPool.cond);
|
||||
if (rc) {
|
||||
rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
|
||||
return (ENOMEM);
|
||||
}
|
||||
raidPtr->parityBufferPool.cond = 0;
|
||||
raidPtr->parityBufferPool.bufferSize = parityBufferCapacity *
|
||||
raidPtr->bytesPerSector;
|
||||
printf("parityBufferPool.bufferSize %d\n",
|
||||
|
@ -400,7 +390,6 @@ rf_ConfigureParityLogging(
|
|||
raidPtr->parityBufferPool.totalBuffers * sizeof(caddr_t),
|
||||
(caddr_t *));
|
||||
if (raidPtr->parityBufferPool.buffers == NULL) {
|
||||
rf_cond_destroy(&raidPtr->parityBufferPool.cond);
|
||||
return (ENOMEM);
|
||||
}
|
||||
for (i = 0; i < raidPtr->parityBufferPool.totalBuffers; i++) {
|
||||
|
@ -411,7 +400,6 @@ rf_ConfigureParityLogging(
|
|||
raidPtr->parityBufferPool.bufferSize * sizeof(char),
|
||||
(caddr_t));
|
||||
if (raidPtr->parityBufferPool.buffers == NULL) {
|
||||
rf_cond_destroy(&raidPtr->parityBufferPool.cond);
|
||||
for (j = 0; j < i; j++) {
|
||||
RF_Free(raidPtr->parityBufferPool.buffers[i],
|
||||
raidPtr->regionBufferPool.bufferSize *
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_threadstuff.c,v 1.16 2003/12/29 05:22:16 oster Exp $ */
|
||||
/* $NetBSD: rf_threadstuff.c,v 1.17 2003/12/29 05:36:19 oster Exp $ */
|
||||
/*
|
||||
* rf_threadstuff.c
|
||||
*/
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.16 2003/12/29 05:22:16 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.17 2003/12/29 05:36:19 oster Exp $");
|
||||
|
||||
#include <dev/raidframe/raidframevar.h>
|
||||
|
||||
|
@ -38,24 +38,10 @@ __KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.16 2003/12/29 05:22:16 oster Ex
|
|||
#include "rf_general.h"
|
||||
#include "rf_shutdown.h"
|
||||
|
||||
static void cond_destroyer(void *);
|
||||
|
||||
/*
|
||||
* Shared stuff
|
||||
*/
|
||||
|
||||
static void
|
||||
cond_destroyer(arg)
|
||||
void *arg;
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = rf_cond_destroy(arg);
|
||||
if (rc) {
|
||||
RF_ERRORMSG1("RAIDFRAME: Error %d auto-destroying condition\n", rc);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
int
|
||||
_rf_create_managed_lkmgr_mutex(listp, m, file, line)
|
||||
|
@ -87,20 +73,9 @@ RF_DECLARE_COND(*c)
|
|||
char *file;
|
||||
int line;
|
||||
{
|
||||
int rc, rc1;
|
||||
|
||||
rc = rf_cond_init(c);
|
||||
if (rc)
|
||||
return (rc);
|
||||
rc = _rf_ShutdownCreate(listp, cond_destroyer, (void *) c, file, line);
|
||||
if (rc) {
|
||||
RF_ERRORMSG1("RAIDFRAME: Error %d adding shutdown entry\n", rc);
|
||||
rc1 = rf_cond_destroy(c);
|
||||
if (rc1) {
|
||||
RF_ERRORMSG1("RAIDFRAME: Error %d destroying cond\n", rc1);
|
||||
}
|
||||
}
|
||||
return (rc);
|
||||
c = 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -119,40 +94,6 @@ _rf_init_managed_threadgroup(listp, g, file, line)
|
|||
g->created = g->running = g->shutdown = 0;
|
||||
return (0);
|
||||
}
|
||||
#if 0
|
||||
int
|
||||
_rf_destroy_threadgroup(g, file, line)
|
||||
RF_ThreadGroup_t *g;
|
||||
char *file;
|
||||
int line;
|
||||
{
|
||||
int rc1, rc2;
|
||||
|
||||
rc2 = rf_cond_destroy(&g->cond);
|
||||
if (rc1)
|
||||
return (rc1);
|
||||
return (rc2);
|
||||
}
|
||||
|
||||
int
|
||||
_rf_init_threadgroup(g, file, line)
|
||||
RF_ThreadGroup_t *g;
|
||||
char *file;
|
||||
int line;
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = rf_mutex_init(&g->mutex);
|
||||
if (rc)
|
||||
return (rc);
|
||||
rc = rf_cond_init(&g->cond);
|
||||
if (rc) {
|
||||
return (rc);
|
||||
}
|
||||
g->created = g->running = g->shutdown = 0;
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Kernel
|
||||
|
@ -173,18 +114,3 @@ decl_lock_data(, *m)
|
|||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
rf_cond_init(c)
|
||||
RF_DECLARE_COND(*c)
|
||||
{
|
||||
*c = 0; /* no reason */
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
rf_cond_destroy(c)
|
||||
RF_DECLARE_COND(*c)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_threadstuff.h,v 1.16 2003/12/29 05:22:16 oster Exp $ */
|
||||
/* $NetBSD: rf_threadstuff.h,v 1.17 2003/12/29 05:36:19 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -193,6 +193,4 @@ int
|
|||
_rf_create_managed_cond(RF_ShutdownList_t ** listp, int *,
|
||||
char *file, int line);
|
||||
|
||||
int rf_cond_init(int *c);
|
||||
int rf_cond_destroy(int *c);
|
||||
#endif /* !_RF__RF_THREADSTUFF_H_ */
|
||||
|
|
Loading…
Reference in New Issue