int Assemble(struct supertype *st, char *mddev,
struct mddev_ident *ident,
- mddev_dev_t devlist, char *backup_file,
+ struct mddev_dev *devlist, char *backup_file,
int readonly, int runstop,
char *update, char *homehost, int require_homehost,
int verbose, int force)
int start_partial_ok = (runstop >= 0) &&
(force || devlist==NULL || auto_assem);
unsigned int num_devs;
- mddev_dev_t tmpdev;
+ struct mddev_dev *tmpdev;
struct mdinfo info;
struct mdinfo *content = NULL;
char *avail;
devname);
goto loop;
} else { /* reject all those sofar */
- mddev_dev_t td;
+ struct mddev_dev *td;
if (report_missmatch)
fprintf(stderr, Name ": %s overrides previous devices due to good homehost\n",
devname);
#define STOP_MD _IO (MD_MAJOR, 3)
int Build(char *mddev, int chunk, int level, int layout,
- int raiddisks, mddev_dev_t devlist, int assume_clean,
+ int raiddisks, struct mddev_dev *devlist, int assume_clean,
char *bitmap_file, int bitmap_chunk, int write_behind,
int delay, int verbose, int autof, unsigned long long size)
{
int vers;
struct stat stb;
int subdevs = 0, missing_disks = 0;
- mddev_dev_t dv;
+ struct mddev_dev *dv;
int bitmap_fd;
unsigned long long bitmapsize;
int mdfd;
int Create(struct supertype *st, char *mddev,
int chunk, int level, int layout, unsigned long long size, int raiddisks, int sparedisks,
char *name, char *homehost, int *uuid,
- int subdevs, mddev_dev_t devlist,
+ int subdevs, struct mddev_dev *devlist,
int runstop, int verbose, int force, int assume_clean,
char *bitmap_file, int bitmap_chunk, int write_behind, int delay, int autof)
{
char *mindisc = NULL;
char *maxdisc = NULL;
int dnum;
- mddev_dev_t dv;
+ struct mddev_dev *dv;
int fail=0, warn=0;
struct stat stb;
int first_missing = subdevs * 2;
infos = malloc(sizeof(*infos) * total_slots);
for (pass=1; pass <=2 ; pass++) {
- mddev_dev_t moved_disk = NULL; /* the disk that was moved out of the insert point */
+ struct mddev_dev *moved_disk = NULL; /* the disk that was moved out of the insert point */
for (dnum=0, dv = devlist ; dv ;
dv=(dv->next)?(dv->next):moved_disk, dnum++) {
#endif
#include "md_u.h"
#include "md_p.h"
-int Examine(mddev_dev_t devlist, int brief, int export, int scan,
+int Examine(struct mddev_dev *devlist, int brief, int export, int scan,
int SparcAdjust, struct supertype *forcest,
char *homehost)
{
/* add current device to chosen array as a spare */
int mdfd = open_dev(devname2devnum(chosen->sys_name));
if (mdfd >= 0) {
- struct mddev_dev_s devlist;
+ struct mddev_dev devlist;
char devname[20];
devlist.next = NULL;
devlist.used = 0;
int mdfd;
int rv;
struct mdstat_ent *ent;
- struct mddev_dev_s devlist;
+ struct mddev_dev devlist;
if (strchr(devname, '/')) {
fprintf(stderr, Name ": incremental removal requires a "
}
int Manage_subdevs(char *devname, int fd,
- mddev_dev_t devlist, int verbose, int test)
+ struct mddev_dev *devlist, int verbose, int test)
{
/* do something to each dev.
* devmode can be
* For 'f' and 'r', the device can also be a kernel-internal
* name such as 'sdb'.
*/
- mddev_dev_t add_devlist = NULL;
+ struct mddev_dev *add_devlist = NULL;
mdu_array_info_t array;
mdu_disk_info_t disc;
unsigned long long array_size;
- mddev_dev_t dv, next = NULL;
+ struct mddev_dev *dv, *next = NULL;
struct stat stb;
int j, jnext = 0;
int tfd = -1;
* At least it isn't MD_SB_DISKS.
*/
#define MaxDisks 384
-int Monitor(mddev_dev_t devlist,
+int Monitor(struct mddev_dev *devlist,
char *mailaddr, char *alert_cmd,
int period, int daemonise, int scan, int oneshot,
int dosyslog, int test, char* pidfile, int increments)
statelist = st;
}
} else {
- mddev_dev_t dv;
+ struct mddev_dev *dv;
for (dv=devlist ; dv; dv=dv->next) {
struct mddev_ident *mdlist = conf_get_ident(dv->devname);
struct state *st = malloc(sizeof *st);
}
}
if (dev > 0) {
- struct mddev_dev_s devlist;
+ struct mddev_dev devlist;
char devname[20];
devlist.next = NULL;
devlist.used = 0;
char *name;
} *cdevlist = NULL;
-mddev_dev_t load_partitions(void)
+struct mddev_dev *load_partitions(void)
{
FILE *f = fopen("/proc/partitions", "r");
char buf[1024];
- mddev_dev_t rv = NULL;
+ struct mddev_dev *rv = NULL;
if (f == NULL) {
fprintf(stderr, Name ": cannot open /proc/partitions\n");
return NULL;
while (fgets(buf, 1024, f)) {
int major, minor;
char *name, *mp;
- mddev_dev_t d;
+ struct mddev_dev *d;
buf[1023] = '\0';
if (buf[0] != ' ')
return rv;
}
-mddev_dev_t load_containers(void)
+struct mddev_dev *load_containers(void)
{
struct mdstat_ent *mdstat = mdstat_read(1, 0);
struct mdstat_ent *ent;
- mddev_dev_t d;
- mddev_dev_t rv = NULL;
+ struct mddev_dev *d;
+ struct mddev_dev *rv = NULL;
if (!mdstat)
return NULL;
return rv;
}
-static void append_dlist(mddev_dev_t *dlp, mddev_dev_t list)
+static void append_dlist(struct mddev_dev **dlp, struct mddev_dev *list)
{
while (*dlp)
dlp = &(*dlp)->next;
*dlp = list;
}
-mddev_dev_t conf_get_devs()
+struct mddev_dev *conf_get_devs()
{
glob_t globbuf;
struct conf_dev *cd;
int flags = 0;
- static mddev_dev_t dlist = NULL;
+ static struct mddev_dev *dlist = NULL;
unsigned int i;
while (dlist) {
- mddev_dev_t t = dlist;
+ struct mddev_dev *t = dlist;
dlist = dlist->next;
free(t->devname);
free(t);
}
if (flags & GLOB_APPEND) {
for (i=0; i<globbuf.gl_pathc; i++) {
- mddev_dev_t t = malloc(sizeof(*t));
+ struct mddev_dev *t = malloc(sizeof(*t));
t->devname = strdup(globbuf.gl_pathv[i]);
t->next = dlist;
t->used = 0;
char *backup_file = NULL;
int bitmap_chunk = UnSet;
int SparcAdjust = 0;
- mddev_dev_t devlist = NULL;
- mddev_dev_t *devlistend = & devlist;
- mddev_dev_t dv;
+ struct mddev_dev *devlist = NULL;
+ struct mddev_dev **devlistend = & devlist;
+ struct mddev_dev *dv;
int devs_found = 0;
int verbose = 0;
int quiet = 0;
}
} else {
struct mddev_ident *a, *array_list = conf_get_ident(NULL);
- mddev_dev_t devlist = conf_get_devs();
+ struct mddev_dev *devlist = conf_get_devs();
int cnt = 0;
int failures, successes;
if (devlist == NULL) {
int acnt;
ident.autof = autof;
do {
- mddev_dev_t devlist = conf_get_devs();
+ struct mddev_dev *devlist = conf_get_devs();
acnt = 0;
do {
rv2 = Assemble(ss, NULL,
};
/* List of device names - wildcards expanded */
-typedef struct mddev_dev_s {
+struct mddev_dev {
char *devname;
char disposition; /* 'a' for add, 'r' for remove, 'f' for fail.
* Not set for names read from .config
char used; /* set when used */
struct mdinfo *content; /* If devname is a container, this might list
* the remaining member arrays. */
- struct mddev_dev_s *next;
-} *mddev_dev_t;
+ struct mddev_dev *next;
+};
typedef struct mapping {
char *name;
extern int Manage_runstop(char *devname, int fd, int runstop, int quiet);
extern int Manage_resize(char *devname, int fd, long long size, int raid_disks);
extern int Manage_subdevs(char *devname, int fd,
- mddev_dev_t devlist, int verbose, int test);
+ struct mddev_dev *devlist, int verbose, int test);
extern int autodetect(void);
extern int Grow_Add_device(char *devname, int fd, char *newdev);
extern int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int write_behind, int force);
extern int Assemble(struct supertype *st, char *mddev,
struct mddev_ident *ident,
- mddev_dev_t devlist, char *backup_file,
+ struct mddev_dev *devlist, char *backup_file,
int readonly, int runstop,
char *update, char *homehost, int require_homehost,
int verbose, int force);
extern int Build(char *mddev, int chunk, int level, int layout,
- int raiddisks, mddev_dev_t devlist, int assume_clean,
+ int raiddisks, struct mddev_dev *devlist, int assume_clean,
char *bitmap_file, int bitmap_chunk, int write_behind,
int delay, int verbose, int autof, unsigned long long size);
extern int Create(struct supertype *st, char *mddev,
int chunk, int level, int layout, unsigned long long size, int raiddisks, int sparedisks,
char *name, char *homehost, int *uuid,
- int subdevs, mddev_dev_t devlist,
+ int subdevs, struct mddev_dev *devlist,
int runstop, int verbose, int force, int assume_clean,
char *bitmap_file, int bitmap_chunk, int write_behind, int delay, int autof);
extern int Detail(char *dev, int brief, int export, int test, char *homehost);
extern int Detail_Platform(struct superswitch *ss, int scan, int verbose);
extern int Query(char *dev);
-extern int Examine(mddev_dev_t devlist, int brief, int export, int scan,
+extern int Examine(struct mddev_dev *devlist, int brief, int export, int scan,
int SparcAdjust, struct supertype *forcest, char *homehost);
-extern int Monitor(mddev_dev_t devlist,
+extern int Monitor(struct mddev_dev *devlist,
char *mailaddr, char *alert_cmd,
int period, int daemonise, int scan, int oneshot,
int dosyslog, int test, char *pidfile, int increments);
extern int parse_auto(char *str, char *msg, int config);
extern struct mddev_ident *conf_get_ident(char *dev);
-extern mddev_dev_t conf_get_devs(void);
+extern struct mddev_dev *conf_get_devs(void);
extern int conf_test_dev(char *devname);
extern int conf_test_metadata(const char *version, struct dev_policy *pol, int is_homehost);
extern struct createinfo *conf_get_create_info(void);