rf_callback.h revision 1.1 1 /* $NetBSD: rf_callback.h,v 1.1 1998/11/13 04:20:26 oster Exp $ */
2 /*
3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved.
5 *
6 * Author: Mark Holland
7 *
8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation.
13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
16 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 *
18 * Carnegie Mellon requests users of this software to return to
19 *
20 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
24 *
25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes.
27 */
28
29 /*****************************************************************************************
30 *
31 * callback.h -- header file for callback.c
32 *
33 * the reconstruction code must manage concurrent I/Os on multiple drives.
34 * it sometimes needs to suspend operation on a particular drive until some
35 * condition occurs. we can't block the thread, of course, or we wouldn't
36 * be able to manage our other outstanding I/Os. Instead we just suspend
37 * new activity on the indicated disk, and create a callback descriptor and
38 * put it someplace where it will get invoked when the condition that's
39 * stalling us has cleared. When the descriptor is invoked, it will call
40 * a function that will restart operation on the indicated disk.
41 *
42 ****************************************************************************************/
43
44 /* :
45 * Log: rf_callback.h,v
46 * Revision 1.8 1996/08/01 15:57:28 jimz
47 * minor cleanup
48 *
49 * Revision 1.7 1996/07/27 23:36:08 jimz
50 * Solaris port of simulator
51 *
52 * Revision 1.6 1996/06/10 11:55:47 jimz
53 * Straightened out some per-array/not-per-array distinctions, fixed
54 * a couple bugs related to confusion. Added shutdown lists. Removed
55 * layout shutdown function (now subsumed by shutdown lists).
56 *
57 * Revision 1.5 1996/05/23 21:46:35 jimz
58 * checkpoint in code cleanup (release prep)
59 * lots of types, function names have been fixed
60 *
61 * Revision 1.4 1996/05/18 19:51:34 jimz
62 * major code cleanup- fix syntax, make some types consistent,
63 * add prototypes, clean out dead code, et cetera
64 *
65 * Revision 1.3 1996/05/17 16:30:46 jimz
66 * add prototypes
67 *
68 * Revision 1.2 1995/12/01 15:15:55 root
69 * added copyright info
70 *
71 */
72
73 #ifndef _RF__RF_CALLBACK_H_
74 #define _RF__RF_CALLBACK_H_
75
76 #include "rf_types.h"
77
78 struct RF_CallbackDesc_s {
79 void (*callbackFunc)(RF_CBParam_t); /* function to call */
80 RF_CBParam_t callbackArg; /* args to give to function, or just info about this callback */
81 RF_CBParam_t callbackArg2;
82 RF_RowCol_t row; /* disk row and column IDs to give to the callback func */
83 RF_RowCol_t col;
84 RF_CallbackDesc_t *next; /* next entry in list */
85 };
86
87 int rf_ConfigureCallback(RF_ShutdownList_t **listp);
88 RF_CallbackDesc_t *rf_AllocCallbackDesc(void);
89 void rf_FreeCallbackDesc(RF_CallbackDesc_t *p);
90
91 #endif /* !_RF__RF_CALLBACK_H_ */
92