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] != ' ')
d->devname = strdup(name);
d->next = rv;
d->used = 0;
- d->content = NULL;
rv = d;
}
fclose(f);
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;
}
d->next = rv;
d->used = 0;
- d->content = NULL;
rv = d;
}
free_mdstat(mdstat);
}
}
-mddev_ident_t mddevlist = NULL;
-mddev_ident_t *mddevlp = &mddevlist;
+struct mddev_ident *mddevlist = NULL;
+struct mddev_ident **mddevlp = &mddevlist;
static int is_number(char *w)
{
{
char *w;
- struct mddev_ident_s mis;
- mddev_ident_t mi;
+ struct mddev_ident mis;
+ struct mddev_ident *mi;
mis.uuid_set = 0;
mis.super_minor = UnSet;
return &createinfo;
}
-mddev_ident_t conf_get_ident(char *dev)
+struct mddev_ident *conf_get_ident(char *dev)
{
- mddev_ident_t rv;
+ struct mddev_ident *rv;
load_conffile();
rv = mddevlist;
while (dev && rv && (rv->devname == 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;
- t->content = NULL;
dlist = t;
/* printf("one dev is %s\n", t->devname);*/
}
* It can be taken either by a match on devname, name, or
* even super-minor.
*/
- mddev_ident_t dev;
+ struct mddev_ident *dev;
load_conffile();
for (dev = mddevlist; dev; dev = dev->next) {
return 1;
}
-struct mddev_ident_s *conf_match(struct mdinfo *info, struct supertype *st)
+struct mddev_ident *conf_match(struct mdinfo *info, struct supertype *st)
{
- struct mddev_ident_s *array_list, *match;
+ struct mddev_ident *array_list, *match;
int verbose = 0;
char *devname = NULL;
array_list = conf_get_ident(NULL);