File: raidlib.h

package info (click to toggle)
raidtools2 0.90.20010914-15
  • links: PTS
  • area: main
  • in suites: woody
  • size: 692 kB
  • ctags: 467
  • sloc: ansic: 2,861; sh: 187; makefile: 144
file content (38 lines) | stat: -rw-r--r-- 1,268 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * raidlib.h : Utility for the Linux Multiple Devices driver
 *            Copyright (C) 1998 Erik Troan, Ingo Molnar
 *
 * Common includes and declarations.
 *
 * This source is covered by the GNU GPL, the same as all Linux kernel
 * sources.
 */

#ifndef H_RAIDLIB
#define H_RAIDLIB

extern int do_quiet_flag;

#define MIN(a,b)	((a) < (b) ? (a) : (b))
#define OUT(x...) do { if (!do_quiet_flag) fprintf(stderr,##x); } while (0)
#define ERR(x...) fprintf(stderr,##x)

extern struct md_version md_ver;
enum mkraidFunc {mkraid, raid0run };
enum raidFunc {raidstart, raidrun, raidstop, raidsetfaulty,
			raidstop_ro, raidhotremove, raidhotadd, raidhotgenerateerror};
extern md_cfg_entry_t *cfg_head, *cfg;
extern int do_quiet_flag;

extern md_u32 get_random(void);
extern int handleOneConfig(enum raidFunc func, md_cfg_entry_t * cfg);
extern int prepare_raidlib (void);
int open_or_die (char *file);
int do_raidstop (int fd, char *dev, int ro);
int do_raidstart_rw (int fd, char *dev);
int do_raidhotremove (int md_fd, char * disk_name, char *md_name);
int do_raidhotadd (int md_fd, char * disk_name, char *md_name);
int do_raidhotgenerateerror (int md_fd, char * disk_name, char *md_name);
int do_raidsetfaulty (int md_fd, char * disk_name, char * md_name);

#endif