]>
git.ipfire.org Git - thirdparty/mdadm.git/blob - mdadm.h
2 * mdadm - manage Linux "md" devices aka RAID arrays.
4 * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * Email: <neilb@cse.unsw.edu.au>
24 * School of Computer Science and Engineering
25 * The University of New South Wales
30 #define __USE_LARGEFILE64
32 extern __off64_t lseek64
__P ((int __fd
, __off64_t __offset
, int __whence
));
34 #include <sys/types.h>
44 #include <linux/kdev_t.h>
46 #include <sys/ioctl.h>
49 /* I seem to need this to make BLKGETSIZE64 to work... */
57 extern char short_options
[];
58 extern struct option long_options
[];
59 extern char Version
[], Usage
[], Help
[], Help_create
[], Help_build
[], Help_assemble
[];
61 /* structures read from config file */
62 /* List of mddevice names and identifiers
65 * super-minor=decimal-minor-number-from-superblock
66 * devices=comma,separated,list,of,device,names,with,wildcards
68 * If multiple fields are present, the intersection of all matching
69 * devices is considered
71 typedef struct mddev_ident_s
{
77 int super_minor
; /* -1 if not set */
79 char *devices
; /* comma separated list of device
80 * names with wild cards
82 int level
; /* -10 if not set */
83 int raid_disks
; /* -1 if not set */
85 struct mddev_ident_s
*next
;
88 /* List of device names - wildcards expanded */
89 typedef struct mddev_dev_s
{
91 char disposition
; /* 'a' for add, 'r' for remove, 'f' for fail.
92 * Not set for names read from .config
94 struct mddev_dev_s
*next
;
97 typedef struct mapping
{
103 #define Sendmail "/usr/lib/sendmail -t"
106 extern char *map_num(mapping_t
*map
, int num
);
107 extern int map_name(mapping_t
*map
, char *name
);
108 extern mapping_t r5layout
[], pers
[];
110 extern char *map_dev(int major
, int minor
);
113 extern int Manage_ro(char *devname
, int fd
, int readonly
);
114 extern int Manage_runstop(char *devname
, int fd
, int runstop
);
115 extern int Manage_subdevs(char *devname
, int fd
,
116 mddev_dev_t devlist
);
119 extern int Assemble(char *mddev
, int mdfd
,
123 int readonly
, int runstop
,
124 int verbose
, int force
);
126 extern int Build(char *mddev
, int mdfd
, int chunk
, int level
,
128 mddev_dev_t devlist
);
131 extern int Create(char *mddev
, int mdfd
,
132 int chunk
, int level
, int layout
, int size
, int raiddisks
, int sparedisks
,
133 int subdevs
, mddev_dev_t devlist
,
134 int runstop
, int verbose
, int force
);
136 extern int Detail(char *dev
, int brief
);
137 extern int Examine(mddev_dev_t devlist
, int brief
, char *conffile
);
138 extern int Monitor(mddev_dev_t devlist
,
139 char *mailaddr
, char *alert_cmd
,
143 extern int Kill(char *dev
, int force
);
145 extern int md_get_version(int fd
);
146 extern int get_linux_version();
147 extern int parse_uuid(char *str
, int uuid
[4]);
148 extern int check_ext2(int fd
, char *name
);
149 extern int check_reiser(int fd
, char *name
);
150 extern int check_raid(int fd
, char *name
);
152 extern mddev_ident_t
conf_get_ident(char *, char*);
153 extern mddev_dev_t
conf_get_devs(char *);
155 extern char *human_size(long long bytes
);