Sun Mar 15 17:17:23 2009 UTC ()
ansify function definitions


(cegger)
diff -r1.25 -r1.26 src/sys/dev/raidframe/rf_alloclist.c
diff -r1.21 -r1.22 src/sys/dev/raidframe/rf_callback.c
diff -r1.21 -r1.22 src/sys/dev/raidframe/rf_mcpair.c
diff -r1.51 -r1.52 src/sys/dev/raidframe/rf_dagutils.c
diff -r1.120 -r1.121 src/sys/dev/raidframe/rf_driver.c
diff -r1.43 -r1.44 src/sys/dev/raidframe/rf_map.c
diff -r1.258 -r1.259 src/sys/dev/raidframe/rf_netbsdkintf.c
diff -r1.7 -r1.8 src/sys/dev/raidframe/rf_options.c
diff -r1.29 -r1.30 src/sys/dev/raidframe/rf_stripelocks.c

cvs diff -r1.25 -r1.26 src/sys/dev/raidframe/rf_alloclist.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_alloclist.c 2006/11/16 01:33:23 1.25
+++ src/sys/dev/raidframe/rf_alloclist.c 2009/03/15 17:17:23 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_alloclist.c,v 1.25 2006/11/16 01:33:23 christos Exp $ */ 1/* $NetBSD: rf_alloclist.c,v 1.26 2009/03/15 17:17:23 cegger Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Carnegie-Mellon University. 3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Author: Mark Holland 6 * Author: Mark Holland
7 * 7 *
8 * Permission to use, copy, modify and distribute this software and 8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright 9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the 10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions 11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation. 12 * thereof, and that both notices appear in supporting documentation.
13 * 13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 */ 27 */
28 28
29/**************************************************************************** 29/****************************************************************************
30 * 30 *
31 * Alloclist.c -- code to manipulate allocation lists 31 * Alloclist.c -- code to manipulate allocation lists
32 * 32 *
33 * an allocation list is just a list of AllocListElem structures. Each 33 * an allocation list is just a list of AllocListElem structures. Each
34 * such structure contains a fixed-size array of pointers. Calling 34 * such structure contains a fixed-size array of pointers. Calling
35 * FreeAList() causes each pointer to be freed. 35 * FreeAList() causes each pointer to be freed.
36 * 36 *
37 ***************************************************************************/ 37 ***************************************************************************/
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.25 2006/11/16 01:33:23 christos Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: rf_alloclist.c,v 1.26 2009/03/15 17:17:23 cegger Exp $");
41 41
42#include <dev/raidframe/raidframevar.h> 42#include <dev/raidframe/raidframevar.h>
43 43
44#include "rf_options.h" 44#include "rf_options.h"
45#include "rf_threadstuff.h" 45#include "rf_threadstuff.h"
46#include "rf_alloclist.h" 46#include "rf_alloclist.h"
47#include "rf_debugMem.h" 47#include "rf_debugMem.h"
48#include "rf_etimer.h" 48#include "rf_etimer.h"
49#include "rf_general.h" 49#include "rf_general.h"
50#include "rf_shutdown.h" 50#include "rf_shutdown.h"
51#include "rf_netbsd.h" 51#include "rf_netbsd.h"
52 52
53#include <sys/pool.h> 53#include <sys/pool.h>
@@ -110,21 +110,21 @@ rf_FreeAllocList(RF_AllocListElem_t *l) @@ -110,21 +110,21 @@ rf_FreeAllocList(RF_AllocListElem_t *l)
110 for (i = 0; i < p->numPointers; i++) { 110 for (i = 0; i < p->numPointers; i++) {
111 RF_ASSERT(p->pointers[i]); 111 RF_ASSERT(p->pointers[i]);
112 RF_Free(p->pointers[i], p->sizes[i]); 112 RF_Free(p->pointers[i], p->sizes[i]);
113 } 113 }
114 } 114 }
115 while (l) { 115 while (l) {
116 temp = l; 116 temp = l;
117 l = l->next; 117 l = l->next;
118 pool_put(&rf_pools.alloclist, temp); 118 pool_put(&rf_pools.alloclist, temp);
119 } 119 }
120} 120}
121 121
122RF_AllocListElem_t * 122RF_AllocListElem_t *
123rf_real_MakeAllocList() 123rf_real_MakeAllocList(void)
124{ 124{
125 RF_AllocListElem_t *p; 125 RF_AllocListElem_t *p;
126 126
127 p = pool_get(&rf_pools.alloclist, PR_WAITOK); 127 p = pool_get(&rf_pools.alloclist, PR_WAITOK);
128 memset((char *) p, 0, sizeof(RF_AllocListElem_t)); 128 memset((char *) p, 0, sizeof(RF_AllocListElem_t));
129 return (p); 129 return (p);
130} 130}

cvs diff -r1.21 -r1.22 src/sys/dev/raidframe/rf_callback.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_callback.c 2009/03/14 15:36:20 1.21
+++ src/sys/dev/raidframe/rf_callback.c 2009/03/15 17:17:23 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_callback.c,v 1.21 2009/03/14 15:36:20 dsl Exp $ */ 1/* $NetBSD: rf_callback.c,v 1.22 2009/03/15 17:17:23 cegger Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Carnegie-Mellon University. 3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Author: Jim Zelenka 6 * Author: Jim Zelenka
7 * 7 *
8 * Permission to use, copy, modify and distribute this software and 8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright 9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the 10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions 11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation. 12 * thereof, and that both notices appear in supporting documentation.
13 * 13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * 24 *
25 * any improvements or extensions that they make and grant Carnegie the 25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes. 26 * rights to redistribute these changes.
27 */ 27 */
28 28
29/***************************************************************************** 29/*****************************************************************************
30 * 30 *
31 * callback.c -- code to manipulate callback descriptor 31 * callback.c -- code to manipulate callback descriptor
32 * 32 *
33 ****************************************************************************/ 33 ****************************************************************************/
34 34
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.21 2009/03/14 15:36:20 dsl Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: rf_callback.c,v 1.22 2009/03/15 17:17:23 cegger Exp $");
38 38
39#include <dev/raidframe/raidframevar.h> 39#include <dev/raidframe/raidframevar.h>
40#include <sys/pool.h> 40#include <sys/pool.h>
41 41
42#include "rf_archs.h" 42#include "rf_archs.h"
43#include "rf_threadstuff.h" 43#include "rf_threadstuff.h"
44#include "rf_callback.h" 44#include "rf_callback.h"
45#include "rf_debugMem.h" 45#include "rf_debugMem.h"
46#include "rf_general.h" 46#include "rf_general.h"
47#include "rf_shutdown.h" 47#include "rf_shutdown.h"
48#include "rf_netbsd.h" 48#include "rf_netbsd.h"
49 49
50#define RF_MAX_FREE_CALLBACK 64 50#define RF_MAX_FREE_CALLBACK 64
@@ -59,26 +59,26 @@ rf_ShutdownCallback(void *ignored) @@ -59,26 +59,26 @@ rf_ShutdownCallback(void *ignored)
59 59
60int 60int
61rf_ConfigureCallback(RF_ShutdownList_t **listp) 61rf_ConfigureCallback(RF_ShutdownList_t **listp)
62{ 62{
63 63
64 rf_pool_init(&rf_pools.callback, sizeof(RF_CallbackDesc_t), 64 rf_pool_init(&rf_pools.callback, sizeof(RF_CallbackDesc_t),
65 "rf_callbackpl", RF_MIN_FREE_CALLBACK, RF_MAX_FREE_CALLBACK); 65 "rf_callbackpl", RF_MIN_FREE_CALLBACK, RF_MAX_FREE_CALLBACK);
66 rf_ShutdownCreate(listp, rf_ShutdownCallback, NULL); 66 rf_ShutdownCreate(listp, rf_ShutdownCallback, NULL);
67 67
68 return (0); 68 return (0);
69} 69}
70 70
71RF_CallbackDesc_t * 71RF_CallbackDesc_t *
72rf_AllocCallbackDesc() 72rf_AllocCallbackDesc(void)
73{ 73{
74 RF_CallbackDesc_t *p; 74 RF_CallbackDesc_t *p;
75 75
76 p = pool_get(&rf_pools.callback, PR_WAITOK); 76 p = pool_get(&rf_pools.callback, PR_WAITOK);
77 return (p); 77 return (p);
78} 78}
79 79
80void 80void
81rf_FreeCallbackDesc(RF_CallbackDesc_t *p) 81rf_FreeCallbackDesc(RF_CallbackDesc_t *p)
82{ 82{
83 pool_put(&rf_pools.callback, p); 83 pool_put(&rf_pools.callback, p);
84} 84}

cvs diff -r1.21 -r1.22 src/sys/dev/raidframe/rf_mcpair.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_mcpair.c 2006/11/16 01:33:23 1.21
+++ src/sys/dev/raidframe/rf_mcpair.c 2009/03/15 17:17:23 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_mcpair.c,v 1.21 2006/11/16 01:33:23 christos Exp $ */ 1/* $NetBSD: rf_mcpair.c,v 1.22 2009/03/15 17:17:23 cegger Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Carnegie-Mellon University. 3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Author: Jim Zelenka 6 * Author: Jim Zelenka
7 * 7 *
8 * Permission to use, copy, modify and distribute this software and 8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright 9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the 10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions 11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation. 12 * thereof, and that both notices appear in supporting documentation.
13 * 13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22 * Carnegie Mellon University 22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890 23 * Pittsburgh PA 15213-3890
24 * 24 *
25 * any improvements or extensions that they make and grant Carnegie the 25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes. 26 * rights to redistribute these changes.
27 */ 27 */
28 28
29/* rf_mcpair.c 29/* rf_mcpair.c
30 * an mcpair is a structure containing a mutex and a condition variable. 30 * an mcpair is a structure containing a mutex and a condition variable.
31 * it's used to block the current thread until some event occurs. 31 * it's used to block the current thread until some event occurs.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.21 2006/11/16 01:33:23 christos Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: rf_mcpair.c,v 1.22 2009/03/15 17:17:23 cegger Exp $");
36 36
37#include <dev/raidframe/raidframevar.h> 37#include <dev/raidframe/raidframevar.h>
38 38
39#include "rf_archs.h" 39#include "rf_archs.h"
40#include "rf_threadstuff.h" 40#include "rf_threadstuff.h"
41#include "rf_mcpair.h" 41#include "rf_mcpair.h"
42#include "rf_debugMem.h" 42#include "rf_debugMem.h"
43#include "rf_general.h" 43#include "rf_general.h"
44#include "rf_shutdown.h" 44#include "rf_shutdown.h"
45#include "rf_netbsd.h" 45#include "rf_netbsd.h"
46 46
47#include <sys/pool.h> 47#include <sys/pool.h>
48#include <sys/proc.h> 48#include <sys/proc.h>
@@ -60,27 +60,27 @@ rf_ShutdownMCPair(void *ignored) @@ -60,27 +60,27 @@ rf_ShutdownMCPair(void *ignored)
60 60
61int 61int
62rf_ConfigureMCPair(RF_ShutdownList_t **listp) 62rf_ConfigureMCPair(RF_ShutdownList_t **listp)
63{ 63{
64 64
65 rf_pool_init(&rf_pools.mcpair, sizeof(RF_MCPair_t), 65 rf_pool_init(&rf_pools.mcpair, sizeof(RF_MCPair_t),
66 "rf_mcpair_pl", RF_MIN_FREE_MCPAIR, RF_MAX_FREE_MCPAIR); 66 "rf_mcpair_pl", RF_MIN_FREE_MCPAIR, RF_MAX_FREE_MCPAIR);
67 rf_ShutdownCreate(listp, rf_ShutdownMCPair, NULL); 67 rf_ShutdownCreate(listp, rf_ShutdownMCPair, NULL);
68 68
69 return (0); 69 return (0);
70} 70}
71 71
72RF_MCPair_t * 72RF_MCPair_t *
73rf_AllocMCPair() 73rf_AllocMCPair(void)
74{ 74{
75 RF_MCPair_t *t; 75 RF_MCPair_t *t;
76 76
77 t = pool_get(&rf_pools.mcpair, PR_WAITOK); 77 t = pool_get(&rf_pools.mcpair, PR_WAITOK);
78 simple_lock_init(&t->mutex); 78 simple_lock_init(&t->mutex);
79 t->cond = 0; 79 t->cond = 0;
80 t->flag = 0; 80 t->flag = 0;
81 81
82 return (t); 82 return (t);
83} 83}
84 84
85void 85void
86rf_FreeMCPair(RF_MCPair_t *t) 86rf_FreeMCPair(RF_MCPair_t *t)

cvs diff -r1.51 -r1.52 src/sys/dev/raidframe/rf_dagutils.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_dagutils.c 2007/03/04 06:02:36 1.51
+++ src/sys/dev/raidframe/rf_dagutils.c 2009/03/15 17:17:23 1.52
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_dagutils.c,v 1.51 2007/03/04 06:02:36 christos Exp $ */ 1/* $NetBSD: rf_dagutils.c,v 1.52 2009/03/15 17:17:23 cegger Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Carnegie-Mellon University. 3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Authors: Mark Holland, William V. Courtright II, Jim Zelenka 6 * Authors: Mark Holland, William V. Courtright II, Jim Zelenka
7 * 7 *
8 * Permission to use, copy, modify and distribute this software and 8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright 9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the 10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions 11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation. 12 * thereof, and that both notices appear in supporting documentation.
13 * 13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * Pittsburgh PA 15213-3890 23 * Pittsburgh PA 15213-3890
24 * 24 *
25 * any improvements or extensions that they make and grant Carnegie the 25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes. 26 * rights to redistribute these changes.
27 */ 27 */
28 28
29/****************************************************************************** 29/******************************************************************************
30 * 30 *
31 * rf_dagutils.c -- utility routines for manipulating dags 31 * rf_dagutils.c -- utility routines for manipulating dags
32 * 32 *
33 *****************************************************************************/ 33 *****************************************************************************/
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.51 2007/03/04 06:02:36 christos Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.52 2009/03/15 17:17:23 cegger Exp $");
37 37
38#include <dev/raidframe/raidframevar.h> 38#include <dev/raidframe/raidframevar.h>
39 39
40#include "rf_archs.h" 40#include "rf_archs.h"
41#include "rf_threadstuff.h" 41#include "rf_threadstuff.h"
42#include "rf_raid.h" 42#include "rf_raid.h"
43#include "rf_dag.h" 43#include "rf_dag.h"
44#include "rf_dagutils.h" 44#include "rf_dagutils.h"
45#include "rf_dagfuncs.h" 45#include "rf_dagfuncs.h"
46#include "rf_general.h" 46#include "rf_general.h"
47#include "rf_map.h" 47#include "rf_map.h"
48#include "rf_shutdown.h" 48#include "rf_shutdown.h"
49 49
@@ -244,98 +244,98 @@ rf_ConfigureDAGs(RF_ShutdownList_t **lis @@ -244,98 +244,98 @@ rf_ConfigureDAGs(RF_ShutdownList_t **lis
244 "rf_dagh_pl", RF_MIN_FREE_DAGH, RF_MAX_FREE_DAGH); 244 "rf_dagh_pl", RF_MIN_FREE_DAGH, RF_MAX_FREE_DAGH);
245 rf_pool_init(&rf_pools.daglist, sizeof(RF_DagList_t), 245 rf_pool_init(&rf_pools.daglist, sizeof(RF_DagList_t),
246 "rf_daglist_pl", RF_MIN_FREE_DAGLIST, RF_MAX_FREE_DAGLIST); 246 "rf_daglist_pl", RF_MIN_FREE_DAGLIST, RF_MAX_FREE_DAGLIST);
247 rf_pool_init(&rf_pools.dagpcache, RF_DAGPCACHE_SIZE, 247 rf_pool_init(&rf_pools.dagpcache, RF_DAGPCACHE_SIZE,
248 "rf_dagpcache_pl", RF_MIN_FREE_DAGPCACHE, RF_MAX_FREE_DAGPCACHE); 248 "rf_dagpcache_pl", RF_MIN_FREE_DAGPCACHE, RF_MAX_FREE_DAGPCACHE);
249 rf_pool_init(&rf_pools.funclist, sizeof(RF_FuncList_t), 249 rf_pool_init(&rf_pools.funclist, sizeof(RF_FuncList_t),
250 "rf_funclist_pl", RF_MIN_FREE_FUNCLIST, RF_MAX_FREE_FUNCLIST); 250 "rf_funclist_pl", RF_MIN_FREE_FUNCLIST, RF_MAX_FREE_FUNCLIST);
251 rf_ShutdownCreate(listp, rf_ShutdownDAGs, NULL); 251 rf_ShutdownCreate(listp, rf_ShutdownDAGs, NULL);
252 252
253 return (0); 253 return (0);
254} 254}
255 255
256RF_DagHeader_t * 256RF_DagHeader_t *
257rf_AllocDAGHeader() 257rf_AllocDAGHeader(void)
258{ 258{
259 RF_DagHeader_t *dh; 259 RF_DagHeader_t *dh;
260 260
261 dh = pool_get(&rf_pools.dagh, PR_WAITOK); 261 dh = pool_get(&rf_pools.dagh, PR_WAITOK);
262 memset((char *) dh, 0, sizeof(RF_DagHeader_t)); 262 memset((char *) dh, 0, sizeof(RF_DagHeader_t));
263 return (dh); 263 return (dh);
264} 264}
265 265
266void 266void
267rf_FreeDAGHeader(RF_DagHeader_t * dh) 267rf_FreeDAGHeader(RF_DagHeader_t * dh)
268{ 268{
269 pool_put(&rf_pools.dagh, dh); 269 pool_put(&rf_pools.dagh, dh);
270} 270}
271 271
272RF_DagNode_t * 272RF_DagNode_t *
273rf_AllocDAGNode() 273rf_AllocDAGNode(void)
274{ 274{
275 RF_DagNode_t *node; 275 RF_DagNode_t *node;
276 276
277 node = pool_get(&rf_pools.dagnode, PR_WAITOK); 277 node = pool_get(&rf_pools.dagnode, PR_WAITOK);
278 memset(node, 0, sizeof(RF_DagNode_t)); 278 memset(node, 0, sizeof(RF_DagNode_t));
279 return (node); 279 return (node);
280} 280}
281 281
282void 282void
283rf_FreeDAGNode(RF_DagNode_t *node) 283rf_FreeDAGNode(RF_DagNode_t *node)
284{ 284{
285 if (node->big_dag_ptrs) { 285 if (node->big_dag_ptrs) {
286 rf_FreeDAGPCache(node->big_dag_ptrs); 286 rf_FreeDAGPCache(node->big_dag_ptrs);
287 } 287 }
288 if (node->big_dag_params) { 288 if (node->big_dag_params) {
289 rf_FreeDAGPCache(node->big_dag_params); 289 rf_FreeDAGPCache(node->big_dag_params);
290 } 290 }
291 pool_put(&rf_pools.dagnode, node); 291 pool_put(&rf_pools.dagnode, node);
292} 292}
293 293
294RF_DagList_t * 294RF_DagList_t *
295rf_AllocDAGList() 295rf_AllocDAGList(void)
296{ 296{
297 RF_DagList_t *dagList; 297 RF_DagList_t *dagList;
298 298
299 dagList = pool_get(&rf_pools.daglist, PR_WAITOK); 299 dagList = pool_get(&rf_pools.daglist, PR_WAITOK);
300 memset(dagList, 0, sizeof(RF_DagList_t)); 300 memset(dagList, 0, sizeof(RF_DagList_t));
301 301
302 return (dagList); 302 return (dagList);
303} 303}
304 304
305void 305void
306rf_FreeDAGList(RF_DagList_t *dagList) 306rf_FreeDAGList(RF_DagList_t *dagList)
307{ 307{
308 pool_put(&rf_pools.daglist, dagList); 308 pool_put(&rf_pools.daglist, dagList);
309} 309}
310 310
311void * 311void *
312rf_AllocDAGPCache() 312rf_AllocDAGPCache(void)
313{ 313{
314 void *p; 314 void *p;
315 p = pool_get(&rf_pools.dagpcache, PR_WAITOK); 315 p = pool_get(&rf_pools.dagpcache, PR_WAITOK);
316 memset(p, 0, RF_DAGPCACHE_SIZE); 316 memset(p, 0, RF_DAGPCACHE_SIZE);
317 317
318 return (p); 318 return (p);
319} 319}
320 320
321void 321void
322rf_FreeDAGPCache(void *p) 322rf_FreeDAGPCache(void *p)
323{ 323{
324 pool_put(&rf_pools.dagpcache, p); 324 pool_put(&rf_pools.dagpcache, p);
325} 325}
326 326
327RF_FuncList_t * 327RF_FuncList_t *
328rf_AllocFuncList() 328rf_AllocFuncList(void)
329{ 329{
330 RF_FuncList_t *funcList; 330 RF_FuncList_t *funcList;
331 331
332 funcList = pool_get(&rf_pools.funclist, PR_WAITOK); 332 funcList = pool_get(&rf_pools.funclist, PR_WAITOK);
333 memset(funcList, 0, sizeof(RF_FuncList_t)); 333 memset(funcList, 0, sizeof(RF_FuncList_t));
334 334
335 return (funcList); 335 return (funcList);
336} 336}
337 337
338void 338void
339rf_FreeFuncList(RF_FuncList_t *funcList) 339rf_FreeFuncList(RF_FuncList_t *funcList)
340{ 340{
341 pool_put(&rf_pools.funclist, funcList); 341 pool_put(&rf_pools.funclist, funcList);

cvs diff -r1.120 -r1.121 src/sys/dev/raidframe/rf_driver.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_driver.c 2008/12/20 17:04:51 1.120
+++ src/sys/dev/raidframe/rf_driver.c 2009/03/15 17:17:23 1.121
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_driver.c,v 1.120 2008/12/20 17:04:51 oster Exp $ */ 1/* $NetBSD: rf_driver.c,v 1.121 2009/03/15 17:17:23 cegger Exp $ */
2/*- 2/*-
3 * Copyright (c) 1999 The NetBSD Foundation, Inc. 3 * Copyright (c) 1999 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Greg Oster 7 * by Greg Oster
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * rights to redistribute these changes. 56 * rights to redistribute these changes.
57 */ 57 */
58 58
59/****************************************************************************** 59/******************************************************************************
60 * 60 *
61 * rf_driver.c -- main setup, teardown, and access routines for the RAID driver 61 * rf_driver.c -- main setup, teardown, and access routines for the RAID driver
62 * 62 *
63 * all routines are prefixed with rf_ (raidframe), to avoid conficts. 63 * all routines are prefixed with rf_ (raidframe), to avoid conficts.
64 * 64 *
65 ******************************************************************************/ 65 ******************************************************************************/
66 66
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.120 2008/12/20 17:04:51 oster Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.121 2009/03/15 17:17:23 cegger Exp $");
70 70
71#ifdef _KERNEL_OPT 71#ifdef _KERNEL_OPT
72#include "opt_raid_diagnostic.h" 72#include "opt_raid_diagnostic.h"
73#endif 73#endif
74 74
75#include <sys/param.h> 75#include <sys/param.h>
76#include <sys/systm.h> 76#include <sys/systm.h>
77#include <sys/ioctl.h> 77#include <sys/ioctl.h>
78#include <sys/fcntl.h> 78#include <sys/fcntl.h>
79#include <sys/vnode.h> 79#include <sys/vnode.h>
80 80
81 81
82#include "rf_archs.h" 82#include "rf_archs.h"
@@ -145,44 +145,44 @@ static int configureCount = 0; /* number @@ -145,44 +145,44 @@ static int configureCount = 0; /* number
145static int isconfigged = 0; /* is basic raidframe (non per-array) 145static int isconfigged = 0; /* is basic raidframe (non per-array)
146 * stuff configured */ 146 * stuff configured */
147RF_DECLARE_LKMGR_STATIC_MUTEX(configureMutex) /* used to lock the configuration 147RF_DECLARE_LKMGR_STATIC_MUTEX(configureMutex) /* used to lock the configuration
148 * stuff */ 148 * stuff */
149static RF_ShutdownList_t *globalShutdown; /* non array-specific 149static RF_ShutdownList_t *globalShutdown; /* non array-specific
150 * stuff */ 150 * stuff */
151 151
152static int rf_ConfigureRDFreeList(RF_ShutdownList_t ** listp); 152static int rf_ConfigureRDFreeList(RF_ShutdownList_t ** listp);
153static int rf_AllocEmergBuffers(RF_Raid_t *); 153static int rf_AllocEmergBuffers(RF_Raid_t *);
154static void rf_FreeEmergBuffers(RF_Raid_t *); 154static void rf_FreeEmergBuffers(RF_Raid_t *);
155 155
156/* called at system boot time */ 156/* called at system boot time */
157int 157int
158rf_BootRaidframe() 158rf_BootRaidframe(void)
159{ 159{
160 160
161 if (raidframe_booted) 161 if (raidframe_booted)
162 return (EBUSY); 162 return (EBUSY);
163 raidframe_booted = 1; 163 raidframe_booted = 1;
164 mutex_init(&configureMutex, MUTEX_DEFAULT, IPL_NONE); 164 mutex_init(&configureMutex, MUTEX_DEFAULT, IPL_NONE);
165 configureCount = 0; 165 configureCount = 0;
166 isconfigged = 0; 166 isconfigged = 0;
167 globalShutdown = NULL; 167 globalShutdown = NULL;
168 return (0); 168 return (0);
169} 169}
170 170
171/* 171/*
172 * Called whenever an array is shutdown 172 * Called whenever an array is shutdown
173 */ 173 */
174static void 174static void
175rf_UnconfigureArray() 175rf_UnconfigureArray(void)
176{ 176{
177 177
178 RF_LOCK_LKMGR_MUTEX(configureMutex); 178 RF_LOCK_LKMGR_MUTEX(configureMutex);
179 if (--configureCount == 0) { /* if no active configurations, shut 179 if (--configureCount == 0) { /* if no active configurations, shut
180 * everything down */ 180 * everything down */
181 isconfigged = 0; 181 isconfigged = 0;
182 rf_ShutdownList(&globalShutdown); 182 rf_ShutdownList(&globalShutdown);
183 183
184 /* 184 /*
185 * We must wait until now, because the AllocList module 185 * We must wait until now, because the AllocList module
186 * uses the DebugMem module. 186 * uses the DebugMem module.
187 */ 187 */
188#if RF_DEBUG_MEM 188#if RF_DEBUG_MEM

cvs diff -r1.43 -r1.44 src/sys/dev/raidframe/rf_map.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_map.c 2007/03/04 06:02:38 1.43
+++ src/sys/dev/raidframe/rf_map.c 2009/03/15 17:17:23 1.44
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_map.c,v 1.43 2007/03/04 06:02:38 christos Exp $ */ 1/* $NetBSD: rf_map.c,v 1.44 2009/03/15 17:17:23 cegger Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Carnegie-Mellon University. 3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Author: Mark Holland 6 * Author: Mark Holland
7 * 7 *
8 * Permission to use, copy, modify and distribute this software and 8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright 9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the 10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions 11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation. 12 * thereof, and that both notices appear in supporting documentation.
13 * 13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * Pittsburgh PA 15213-3890 23 * Pittsburgh PA 15213-3890
24 * 24 *
25 * any improvements or extensions that they make and grant Carnegie the 25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes. 26 * rights to redistribute these changes.
27 */ 27 */
28 28
29/************************************************************************** 29/**************************************************************************
30 * 30 *
31 * map.c -- main code for mapping RAID addresses to physical disk addresses 31 * map.c -- main code for mapping RAID addresses to physical disk addresses
32 * 32 *
33 **************************************************************************/ 33 **************************************************************************/
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.43 2007/03/04 06:02:38 christos Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.44 2009/03/15 17:17:23 cegger Exp $");
37 37
38#include <dev/raidframe/raidframevar.h> 38#include <dev/raidframe/raidframevar.h>
39 39
40#include "rf_threadstuff.h" 40#include "rf_threadstuff.h"
41#include "rf_raid.h" 41#include "rf_raid.h"
42#include "rf_general.h" 42#include "rf_general.h"
43#include "rf_map.h" 43#include "rf_map.h"
44#include "rf_shutdown.h" 44#include "rf_shutdown.h"
45 45
46static void rf_FreePDAList(RF_PhysDiskAddr_t *pda_list); 46static void rf_FreePDAList(RF_PhysDiskAddr_t *pda_list);
47static void rf_FreeASMList(RF_AccessStripeMap_t *asm_list); 47static void rf_FreeASMList(RF_AccessStripeMap_t *asm_list);
48 48
49/*************************************************************************** 49/***************************************************************************
@@ -364,121 +364,121 @@ rf_ConfigureMapModule(RF_ShutdownList_t  @@ -364,121 +364,121 @@ rf_ConfigureMapModule(RF_ShutdownList_t
364 "rf_pda_pl", RF_MIN_FREE_PDA, RF_MAX_FREE_PDA); 364 "rf_pda_pl", RF_MIN_FREE_PDA, RF_MAX_FREE_PDA);
365 rf_pool_init(&rf_pools.fss, sizeof(RF_FailedStripe_t), 365 rf_pool_init(&rf_pools.fss, sizeof(RF_FailedStripe_t),
366 "rf_fss_pl", RF_MIN_FREE_FSS, RF_MAX_FREE_FSS); 366 "rf_fss_pl", RF_MIN_FREE_FSS, RF_MAX_FREE_FSS);
367 rf_pool_init(&rf_pools.vfple, sizeof(RF_VoidFunctionPointerListElem_t), 367 rf_pool_init(&rf_pools.vfple, sizeof(RF_VoidFunctionPointerListElem_t),
368 "rf_vfple_pl", RF_MIN_FREE_VFPLE, RF_MAX_FREE_VFPLE); 368 "rf_vfple_pl", RF_MIN_FREE_VFPLE, RF_MAX_FREE_VFPLE);
369 rf_pool_init(&rf_pools.vple, sizeof(RF_VoidPointerListElem_t), 369 rf_pool_init(&rf_pools.vple, sizeof(RF_VoidPointerListElem_t),
370 "rf_vple_pl", RF_MIN_FREE_VPLE, RF_MAX_FREE_VPLE); 370 "rf_vple_pl", RF_MIN_FREE_VPLE, RF_MAX_FREE_VPLE);
371 rf_ShutdownCreate(listp, rf_ShutdownMapModule, NULL); 371 rf_ShutdownCreate(listp, rf_ShutdownMapModule, NULL);
372 372
373 return (0); 373 return (0);
374} 374}
375 375
376RF_AccessStripeMapHeader_t * 376RF_AccessStripeMapHeader_t *
377rf_AllocAccessStripeMapHeader() 377rf_AllocAccessStripeMapHeader(void)
378{ 378{
379 RF_AccessStripeMapHeader_t *p; 379 RF_AccessStripeMapHeader_t *p;
380 380
381 p = pool_get(&rf_pools.asm_hdr, PR_WAITOK); 381 p = pool_get(&rf_pools.asm_hdr, PR_WAITOK);
382 memset((char *) p, 0, sizeof(RF_AccessStripeMapHeader_t)); 382 memset((char *) p, 0, sizeof(RF_AccessStripeMapHeader_t));
383 383
384 return (p); 384 return (p);
385} 385}
386 386
387void 387void
388rf_FreeAccessStripeMapHeader(RF_AccessStripeMapHeader_t *p) 388rf_FreeAccessStripeMapHeader(RF_AccessStripeMapHeader_t *p)
389{ 389{
390 pool_put(&rf_pools.asm_hdr, p); 390 pool_put(&rf_pools.asm_hdr, p);
391} 391}
392 392
393 393
394RF_VoidFunctionPointerListElem_t * 394RF_VoidFunctionPointerListElem_t *
395rf_AllocVFPListElem() 395rf_AllocVFPListElem(void)
396{ 396{
397 RF_VoidFunctionPointerListElem_t *p; 397 RF_VoidFunctionPointerListElem_t *p;
398 398
399 p = pool_get(&rf_pools.vfple, PR_WAITOK); 399 p = pool_get(&rf_pools.vfple, PR_WAITOK);
400 memset((char *) p, 0, sizeof(RF_VoidFunctionPointerListElem_t)); 400 memset((char *) p, 0, sizeof(RF_VoidFunctionPointerListElem_t));
401 401
402 return (p); 402 return (p);
403} 403}
404 404
405void 405void
406rf_FreeVFPListElem(RF_VoidFunctionPointerListElem_t *p) 406rf_FreeVFPListElem(RF_VoidFunctionPointerListElem_t *p)
407{ 407{
408 408
409 pool_put(&rf_pools.vfple, p); 409 pool_put(&rf_pools.vfple, p);
410} 410}
411 411
412 412
413RF_VoidPointerListElem_t * 413RF_VoidPointerListElem_t *
414rf_AllocVPListElem() 414rf_AllocVPListElem(void)
415{ 415{
416 RF_VoidPointerListElem_t *p; 416 RF_VoidPointerListElem_t *p;
417 417
418 p = pool_get(&rf_pools.vple, PR_WAITOK); 418 p = pool_get(&rf_pools.vple, PR_WAITOK);
419 memset((char *) p, 0, sizeof(RF_VoidPointerListElem_t)); 419 memset((char *) p, 0, sizeof(RF_VoidPointerListElem_t));
420 420
421 return (p); 421 return (p);
422} 422}
423 423
424void 424void
425rf_FreeVPListElem(RF_VoidPointerListElem_t *p) 425rf_FreeVPListElem(RF_VoidPointerListElem_t *p)
426{ 426{
427 427
428 pool_put(&rf_pools.vple, p); 428 pool_put(&rf_pools.vple, p);
429} 429}
430 430
431RF_ASMHeaderListElem_t * 431RF_ASMHeaderListElem_t *
432rf_AllocASMHeaderListElem() 432rf_AllocASMHeaderListElem(void)
433{ 433{
434 RF_ASMHeaderListElem_t *p; 434 RF_ASMHeaderListElem_t *p;
435 435
436 p = pool_get(&rf_pools.asmhle, PR_WAITOK); 436 p = pool_get(&rf_pools.asmhle, PR_WAITOK);
437 memset((char *) p, 0, sizeof(RF_ASMHeaderListElem_t)); 437 memset((char *) p, 0, sizeof(RF_ASMHeaderListElem_t));
438 438
439 return (p); 439 return (p);
440} 440}
441 441
442void 442void
443rf_FreeASMHeaderListElem(RF_ASMHeaderListElem_t *p) 443rf_FreeASMHeaderListElem(RF_ASMHeaderListElem_t *p)
444{ 444{
445 445
446 pool_put(&rf_pools.asmhle, p); 446 pool_put(&rf_pools.asmhle, p);
447} 447}
448 448
449RF_FailedStripe_t * 449RF_FailedStripe_t *
450rf_AllocFailedStripeStruct() 450rf_AllocFailedStripeStruct(void)
451{ 451{
452 RF_FailedStripe_t *p; 452 RF_FailedStripe_t *p;
453 453
454 p = pool_get(&rf_pools.fss, PR_WAITOK); 454 p = pool_get(&rf_pools.fss, PR_WAITOK);
455 memset((char *) p, 0, sizeof(RF_FailedStripe_t)); 455 memset((char *) p, 0, sizeof(RF_FailedStripe_t));
456 456
457 return (p); 457 return (p);
458} 458}
459 459
460void 460void
461rf_FreeFailedStripeStruct(RF_FailedStripe_t *p) 461rf_FreeFailedStripeStruct(RF_FailedStripe_t *p)
462{ 462{
463 pool_put(&rf_pools.fss, p); 463 pool_put(&rf_pools.fss, p);
464} 464}
465 465
466 466
467 467
468 468
469 469
470RF_PhysDiskAddr_t * 470RF_PhysDiskAddr_t *
471rf_AllocPhysDiskAddr() 471rf_AllocPhysDiskAddr(void)
472{ 472{
473 RF_PhysDiskAddr_t *p; 473 RF_PhysDiskAddr_t *p;
474 474
475 p = pool_get(&rf_pools.pda, PR_WAITOK); 475 p = pool_get(&rf_pools.pda, PR_WAITOK);
476 memset((char *) p, 0, sizeof(RF_PhysDiskAddr_t)); 476 memset((char *) p, 0, sizeof(RF_PhysDiskAddr_t));
477 477
478 return (p); 478 return (p);
479} 479}
480/* allocates a list of PDAs, locking the free list only once when we 480/* allocates a list of PDAs, locking the free list only once when we
481 * have to call calloc, we do it one component at a time to simplify 481 * have to call calloc, we do it one component at a time to simplify
482 * the process of freeing the list at program shutdown. This should 482 * the process of freeing the list at program shutdown. This should
483 * not be much of a performance hit, because it should be very 483 * not be much of a performance hit, because it should be very
484 * infrequently executed. */ 484 * infrequently executed. */

cvs diff -r1.258 -r1.259 src/sys/dev/raidframe/rf_netbsdkintf.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_netbsdkintf.c 2009/03/14 11:08:28 1.258
+++ src/sys/dev/raidframe/rf_netbsdkintf.c 2009/03/15 17:17:23 1.259
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_netbsdkintf.c,v 1.258 2009/03/14 11:08:28 ad Exp $ */ 1/* $NetBSD: rf_netbsdkintf.c,v 1.259 2009/03/15 17:17:23 cegger Exp $ */
2/*- 2/*-
3 * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc. 3 * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Greg Oster; Jason R. Thorpe. 7 * by Greg Oster; Jason R. Thorpe.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -129,27 +129,27 @@ @@ -129,27 +129,27 @@
129 * Pittsburgh PA 15213-3890 129 * Pittsburgh PA 15213-3890
130 * 130 *
131 * any improvements or extensions that they make and grant Carnegie the 131 * any improvements or extensions that they make and grant Carnegie the
132 * rights to redistribute these changes. 132 * rights to redistribute these changes.
133 */ 133 */
134 134
135/*********************************************************** 135/***********************************************************
136 * 136 *
137 * rf_kintf.c -- the kernel interface routines for RAIDframe 137 * rf_kintf.c -- the kernel interface routines for RAIDframe
138 * 138 *
139 ***********************************************************/ 139 ***********************************************************/
140 140
141#include <sys/cdefs.h> 141#include <sys/cdefs.h>
142__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.258 2009/03/14 11:08:28 ad Exp $"); 142__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.259 2009/03/15 17:17:23 cegger Exp $");
143 143
144#ifdef _KERNEL_OPT 144#ifdef _KERNEL_OPT
145#include "opt_compat_netbsd.h" 145#include "opt_compat_netbsd.h"
146#include "opt_raid_autoconfig.h" 146#include "opt_raid_autoconfig.h"
147#include "raid.h" 147#include "raid.h"
148#endif 148#endif
149 149
150#include <sys/param.h> 150#include <sys/param.h>
151#include <sys/errno.h> 151#include <sys/errno.h>
152#include <sys/pool.h> 152#include <sys/pool.h>
153#include <sys/proc.h> 153#include <sys/proc.h>
154#include <sys/queue.h> 154#include <sys/queue.h>
155#include <sys/disk.h> 155#include <sys/disk.h>
@@ -2833,27 +2833,27 @@ oomem: @@ -2833,27 +2833,27 @@ oomem:
2833 } 2833 }
2834 } 2834 }
2835 if (!good_one) { 2835 if (!good_one) {
2836 /* cleanup */ 2836 /* cleanup */
2837 free(clabel, M_RAIDFRAME); 2837 free(clabel, M_RAIDFRAME);
2838 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); 2838 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
2839 VOP_CLOSE(vp, FREAD | FWRITE, NOCRED); 2839 VOP_CLOSE(vp, FREAD | FWRITE, NOCRED);
2840 vput(vp); 2840 vput(vp);
2841 } 2841 }
2842 return ac_list; 2842 return ac_list;
2843} 2843}
2844 2844
2845RF_AutoConfig_t * 2845RF_AutoConfig_t *
2846rf_find_raid_components() 2846rf_find_raid_components(void)
2847{ 2847{
2848 struct vnode *vp; 2848 struct vnode *vp;
2849 struct disklabel label; 2849 struct disklabel label;
2850 struct device *dv; 2850 struct device *dv;
2851 dev_t dev; 2851 dev_t dev;
2852 int bmajor, bminor, wedge; 2852 int bmajor, bminor, wedge;
2853 int error; 2853 int error;
2854 int i; 2854 int i;
2855 RF_AutoConfig_t *ac_list; 2855 RF_AutoConfig_t *ac_list;
2856 2856
2857 2857
2858 /* initialize the AutoConfig list */ 2858 /* initialize the AutoConfig list */
2859 ac_list = NULL; 2859 ac_list = NULL;

cvs diff -r1.7 -r1.8 src/sys/dev/raidframe/rf_options.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_options.c 2005/12/11 12:23:37 1.7
+++ src/sys/dev/raidframe/rf_options.c 2009/03/15 17:17:23 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_options.c,v 1.7 2005/12/11 12:23:37 christos Exp $ */ 1/* $NetBSD: rf_options.c,v 1.8 2009/03/15 17:17:23 cegger Exp $ */
2/* 2/*
3 * rf_options.c 3 * rf_options.c
4 */ 4 */
5/* 5/*
6 * Copyright (c) 1996 Carnegie-Mellon University. 6 * Copyright (c) 1996 Carnegie-Mellon University.
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Author: Jim Zelenka 9 * Author: Jim Zelenka
10 * 10 *
11 * Permission to use, copy, modify and distribute this software and 11 * Permission to use, copy, modify and distribute this software and
12 * its documentation is hereby granted, provided that both the copyright 12 * its documentation is hereby granted, provided that both the copyright
13 * notice and this permission notice appear in all copies of the 13 * notice and this permission notice appear in all copies of the
14 * software, derivative works or modified versions, and any portions 14 * software, derivative works or modified versions, and any portions
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * 20 *
21 * Carnegie Mellon requests users of this software to return to 21 * Carnegie Mellon requests users of this software to return to
22 * 22 *
23 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 23 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
24 * School of Computer Science 24 * School of Computer Science
25 * Carnegie Mellon University 25 * Carnegie Mellon University
26 * Pittsburgh PA 15213-3890 26 * Pittsburgh PA 15213-3890
27 * 27 *
28 * any improvements or extensions that they make and grant Carnegie the 28 * any improvements or extensions that they make and grant Carnegie the
29 * rights to redistribute these changes. 29 * rights to redistribute these changes.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: rf_options.c,v 1.7 2005/12/11 12:23:37 christos Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: rf_options.c,v 1.8 2009/03/15 17:17:23 cegger Exp $");
34 34
35#include <dev/raidframe/raidframevar.h> 35#include <dev/raidframe/raidframevar.h>
36 36
37#include "rf_threadstuff.h" 37#include "rf_threadstuff.h"
38#include "rf_archs.h" 38#include "rf_archs.h"
39#include "rf_general.h" 39#include "rf_general.h"
40#include "rf_options.h" 40#include "rf_options.h"
41 41
42#ifdef RF_DBG_OPTION 42#ifdef RF_DBG_OPTION
43#undef RF_DBG_OPTION 43#undef RF_DBG_OPTION
44#endif /* RF_DBG_OPTION */ 44#endif /* RF_DBG_OPTION */
45 45
46#ifdef __STDC__ 46#ifdef __STDC__
@@ -62,17 +62,17 @@ __KERNEL_RCSID(0, "$NetBSD: rf_options.c @@ -62,17 +62,17 @@ __KERNEL_RCSID(0, "$NetBSD: rf_options.c
62RF_DebugName_t rf_debugNames[] = { 62RF_DebugName_t rf_debugNames[] = {
63#include "rf_optnames.h" 63#include "rf_optnames.h"
64 {NULL, NULL} 64 {NULL, NULL}
65}; 65};
66#undef RF_DBG_OPTION 66#undef RF_DBG_OPTION
67 67
68#ifdef __STDC__ 68#ifdef __STDC__
69#define RF_DBG_OPTION(_option_,_defval_) rf_##_option_ = _defval_ ; 69#define RF_DBG_OPTION(_option_,_defval_) rf_##_option_ = _defval_ ;
70#else /* __STDC__ */ 70#else /* __STDC__ */
71#define RF_DBG_OPTION(_option_,_defval_) rf_/**/_option_ = _defval_ ; 71#define RF_DBG_OPTION(_option_,_defval_) rf_/**/_option_ = _defval_ ;
72#endif /* __STDC__ */ 72#endif /* __STDC__ */
73 73
74void 74void
75rf_ResetDebugOptions() 75rf_ResetDebugOptions(void)
76{ 76{
77#include "rf_optnames.h" 77#include "rf_optnames.h"
78} 78}

cvs diff -r1.29 -r1.30 src/sys/dev/raidframe/rf_stripelocks.c (expand / switch to unified diff)

--- src/sys/dev/raidframe/rf_stripelocks.c 2006/11/16 01:33:23 1.29
+++ src/sys/dev/raidframe/rf_stripelocks.c 2009/03/15 17:17:23 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rf_stripelocks.c,v 1.29 2006/11/16 01:33:23 christos Exp $ */ 1/* $NetBSD: rf_stripelocks.c,v 1.30 2009/03/15 17:17:23 cegger Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Carnegie-Mellon University. 3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Authors: Mark Holland, Jim Zelenka 6 * Authors: Mark Holland, Jim Zelenka
7 * 7 *
8 * Permission to use, copy, modify and distribute this software and 8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright 9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the 10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions 11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation. 12 * thereof, and that both notices appear in supporting documentation.
13 * 13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
@@ -47,27 +47,27 @@ @@ -47,27 +47,27 @@
47 * of the stripe. The "addresses" that you lock are abstract in that you 47 * of the stripe. The "addresses" that you lock are abstract in that you
48 * can pass in anything you like. The expectation is that you'll pass in 48 * can pass in anything you like. The expectation is that you'll pass in
49 * the range of physical disk offsets of the parity bits you're planning 49 * the range of physical disk offsets of the parity bits you're planning
50 * to update. The idea behind this, of course, is to allow sub-stripe 50 * to update. The idea behind this, of course, is to allow sub-stripe
51 * locking. The implementation is perhaps not the best imaginable; in the 51 * locking. The implementation is perhaps not the best imaginable; in the
52 * worst case a lock release is O(n^2) in the total number of outstanding 52 * worst case a lock release is O(n^2) in the total number of outstanding
53 * requests to a given stripe. Note that if you're striping with a 53 * requests to a given stripe. Note that if you're striping with a
54 * stripe unit size equal to an entire disk (i.e. not striping), there will 54 * stripe unit size equal to an entire disk (i.e. not striping), there will
55 * be only one stripe and you may spend some significant number of cycles 55 * be only one stripe and you may spend some significant number of cycles
56 * searching through stripe lock descriptors. 56 * searching through stripe lock descriptors.
57 */ 57 */
58 58
59#include <sys/cdefs.h> 59#include <sys/cdefs.h>
60__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.29 2006/11/16 01:33:23 christos Exp $"); 60__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.30 2009/03/15 17:17:23 cegger Exp $");
61 61
62#include <dev/raidframe/raidframevar.h> 62#include <dev/raidframe/raidframevar.h>
63 63
64#include "rf_raid.h" 64#include "rf_raid.h"
65#include "rf_stripelocks.h" 65#include "rf_stripelocks.h"
66#include "rf_alloclist.h" 66#include "rf_alloclist.h"
67#include "rf_debugprint.h" 67#include "rf_debugprint.h"
68#include "rf_general.h" 68#include "rf_general.h"
69#include "rf_driver.h" 69#include "rf_driver.h"
70#include "rf_shutdown.h" 70#include "rf_shutdown.h"
71 71
72#ifdef DEBUG 72#ifdef DEBUG
73 73
@@ -173,27 +173,27 @@ rf_ConfigureStripeLockFreeList(RF_Shutdo @@ -173,27 +173,27 @@ rf_ConfigureStripeLockFreeList(RF_Shutdo
173 rf_ShutdownCreate(listp, rf_ShutdownStripeLockFreeList, NULL); 173 rf_ShutdownCreate(listp, rf_ShutdownStripeLockFreeList, NULL);
174 174
175 for (mask = 0x1; mask; mask <<= 1) 175 for (mask = 0x1; mask; mask <<= 1)
176 if (rf_lockTableSize == mask) 176 if (rf_lockTableSize == mask)
177 break; 177 break;
178 if (!mask) { 178 if (!mask) {
179 printf("[WARNING: lock table size must be a power of two. Setting to %d.]\n", RF_DEFAULT_LOCK_TABLE_SIZE); 179 printf("[WARNING: lock table size must be a power of two. Setting to %d.]\n", RF_DEFAULT_LOCK_TABLE_SIZE);
180 rf_lockTableSize = RF_DEFAULT_LOCK_TABLE_SIZE; 180 rf_lockTableSize = RF_DEFAULT_LOCK_TABLE_SIZE;
181 } 181 }
182 return (0); 182 return (0);
183} 183}
184 184
185static RF_LockTableEntry_t * 185static RF_LockTableEntry_t *
186rf_MakeLockTable() 186rf_MakeLockTable(void)
187{ 187{
188 RF_LockTableEntry_t *lockTable; 188 RF_LockTableEntry_t *lockTable;
189 int i; 189 int i;
190 190
191 RF_Malloc(lockTable, 191 RF_Malloc(lockTable,
192 ((int) rf_lockTableSize) * sizeof(RF_LockTableEntry_t), 192 ((int) rf_lockTableSize) * sizeof(RF_LockTableEntry_t),
193 (RF_LockTableEntry_t *)); 193 (RF_LockTableEntry_t *));
194 if (lockTable == NULL) 194 if (lockTable == NULL)
195 return (NULL); 195 return (NULL);
196 for (i = 0; i < rf_lockTableSize; i++) { 196 for (i = 0; i < rf_lockTableSize; i++) {
197 rf_mutex_init(&lockTable[i].mutex); 197 rf_mutex_init(&lockTable[i].mutex);
198 } 198 }
199 return (lockTable); 199 return (lockTable);