File: raidlib.h

package info (click to toggle)
raidtools2 0.90.990824-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 688 kB
  • ctags: 468
  • sloc: ansic: 2,631; makefile: 143; sh: 114
file content (37 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (2)
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
/*
 * raidlib.h : Utility for the Linux Multiple Devices driver
 *            Copyright (C) 1998, 1999 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,
		raidstop_ro, raidhotremove, raidhotadd, raidsetfaulty };
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_raidsetfaulty (int md_fd, char * disk_name, char * md_name);

#endif