]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/raidframe/rf_kintf.h
This commit was generated by cvs2svn to compensate for changes in r106907,
[FreeBSD/FreeBSD.git] / sys / dev / raidframe / rf_kintf.h
1 /*      $FreeBSD$ */
2 /*      $NetBSD: rf_kintf.h,v 1.15 2000/10/20 02:24:45 oster Exp $      */
3 /*
4  * rf_kintf.h
5  *
6  * RAIDframe exported kernel interface
7  */
8 /*
9  * Copyright (c) 1995 Carnegie-Mellon University.
10  * All rights reserved.
11  *
12  * Author: Jim Zelenka
13  *
14  * Permission to use, copy, modify and distribute this software and
15  * its documentation is hereby granted, provided that both the copyright
16  * notice and this permission notice appear in all copies of the
17  * software, derivative works or modified versions, and any portions
18  * thereof, and that both notices appear in supporting documentation.
19  *
20  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
21  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
22  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
23  *
24  * Carnegie Mellon requests users of this software to return to
25  *
26  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
27  *  School of Computer Science
28  *  Carnegie Mellon University
29  *  Pittsburgh PA 15213-3890
30  *
31  * any improvements or extensions that they make and grant Carnegie the
32  * rights to redistribute these changes.
33  */
34
35 #ifndef _RF__RF_KINTF_H_
36 #define _RF__RF_KINTF_H_
37
38 #include <dev/raidframe/rf_types.h>
39
40 #if defined(__NetBSD__)
41 #define RF_LTSLEEP(cond, pri, text, time, mutex)        \
42                 ltsleep(cond, pri, text, time, mutex)
43 #elif defined(__FreeBSD__)
44 #if __FreeBSD_version > 500005
45 #define RF_LTSLEEP(cond, pri, text, time, mutex) \
46                 msleep(cond, mutex, pri, text, time);
47 #else
48 static __inline int
49 RF_LTSLEEP(void *cond, int pri, const char *text, int time, struct simplelock *mutex)
50 {
51         int ret;
52         if (mutex != NULL)
53                 simple_unlock(mutex);
54         ret = tsleep(cond, pri, text, time);
55         if (mutex != NULL)
56                 simple_lock(mutex);
57         return (ret);
58 }
59 #endif
60 #endif
61
62 int     rf_GetSpareTableFromDaemon(RF_SparetWait_t * req);
63
64 void    raidstart(RF_Raid_t * raidPtr);
65 int     rf_DispatchKernelIO(RF_DiskQueue_t * queue, RF_DiskQueueData_t * req);
66
67 int raidwrite_component_label(dev_t, struct vnode *, RF_ComponentLabel_t *);
68 int raidread_component_label(dev_t, struct vnode *, RF_ComponentLabel_t *);
69
70 #define RF_NORMAL_COMPONENT_UPDATE 0
71 #define RF_FINAL_COMPONENT_UPDATE 1
72 void rf_update_component_labels(RF_Raid_t *, int);
73 int raidlookup(char *, RF_Thread_t, struct vnode **);
74 int raidmarkclean(dev_t dev, struct vnode *b_vp, int);
75 int raidmarkdirty(dev_t dev, struct vnode *b_vp, int);
76 void raid_init_component_label(RF_Raid_t *, RF_ComponentLabel_t *);
77 void rf_print_component_label(RF_ComponentLabel_t *);
78 void rf_UnconfigureVnodes( RF_Raid_t * );
79 void rf_close_component( RF_Raid_t *, struct vnode *, int);
80 void rf_disk_unbusy(RF_RaidAccessDesc_t *);
81 int raid_getcomponentsize(RF_Raid_t *, RF_RowCol_t, RF_RowCol_t);
82 #endif                          /* _RF__RF_KINTF_H_ */