The 'superblock' will be moved into this structure soon.
fprintf( stderr, Name ": no RAID superblock on %s\n",
devname);
} else {
- tst->ss->getinfo_super(&info, super);
+ tst->ss->getinfo_super(tst, &info, super);
}
if (dfd >= 0) close(dfd);
if (tst == NULL || super == NULL)
continue;
if (update == NULL &&
- tst->ss->match_home(super, homehost)==0) {
+ tst->ss->match_home(tst, super, homehost)==0) {
if ((inargv && verbose >= 0) || verbose > 0)
fprintf(stderr, Name ": %s is not built for host %s.\n",
devname, homehost);
if (!super) {
fprintf(stderr, Name ": %s has no superblock - assembly aborted\n",
devname);
- st->ss->free_super(first_super);
+ st->ss->free_super(st, first_super);
return 1;
}
if (mdfd < 0)
goto loop;
if (homehost) {
- int first = st->ss->match_home(first_super, homehost);
- int last = tst->ss->match_home(super, homehost);
+ int first = st->ss->match_home(st, first_super,
+ homehost);
+ int last = tst->ss->match_home(tst, super,
+ homehost);
if (first+last == 1) {
/* We can do something */
if (first) {/* just ignore this one */
}
fprintf(stderr, Name ": superblock on %s doesn't match others - assembly aborted\n",
devname);
- tst->ss->free_super(super);
- st->ss->free_super(first_super);
+ tst->ss->free_super(tst, super);
+ st->ss->free_super(st, first_super);
return 1;
}
loop:
if (super)
- tst->ss->free_super(super);
+ tst->ss->free_super(tst, super);
super = NULL;
}
if (!first_super) {
return 2;
}
- st->ss->getinfo_super(&info, first_super);
+ st->ss->getinfo_super(st, &info, first_super);
c = strchr(info.name, ':');
if (c) c++; else c= info.name;
if (isdigit(*c) && ((ident->autof & 7)==4 || (ident->autof&7)==6))
asprintf(&mddev, "/dev/md/%s", c);
mdfd = open_mddev(mddev, ident->autof);
if (mdfd < 0) {
- st->ss->free_super(first_super);
+ st->ss->free_super(st, first_super);
free(devices);
first_super = NULL;
goto try_again;
mddev, tmpdev->devname);
close(mdfd);
mdfd = -1;
- st->ss->free_super(first_super);
+ st->ss->free_super(st, first_super);
free(devices);
first_super = NULL;
goto try_again;
remove_partitions(dfd);
st->ss->load_super(st, dfd, &super, NULL);
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
memcpy(info.uuid, ident->uuid, 16);
strcpy(info.name, ident->name);
info.array.md_minor = minor(stb2.st_rdev);
- st->ss->update_super(&info, super, update, devname, verbose,
+ st->ss->update_super(st, &info, super, update,
+ devname, verbose,
ident->uuid_set, homehost);
if (strcmp(update, "uuid")==0 &&
!ident->uuid_set) {
remove_partitions(dfd);
st->ss->load_super(st, dfd, &super, NULL);
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
close(dfd);
}
devcnt++;
if (super)
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
super = NULL;
}
if (devcnt == 0) {
fprintf(stderr, Name ": no devices found for %s\n",
mddev);
- st->ss->free_super(first_super);
+ st->ss->free_super(st, first_super);
if (must_close) close(mdfd);
return 1;
}
- st->ss->getinfo_super(&info, first_super);
+ st->ss->getinfo_super(st, &info, first_super);
clean = info.array.state & 1;
/* now we have some devices that might be suitable.
continue;
}
info.events = devices[most_recent].events;
- st->ss->update_super(&info, super, "force-one",
+ st->ss->update_super(st, &info, super, "force-one",
devices[chosen_drive].devname, verbose,
0, NULL);
fprintf(stderr, Name ": Could not re-write superblock on %s\n",
devices[chosen_drive].devname);
devices[chosen_drive].events = 0;
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
continue;
}
close(fd);
devices[chosen_drive].uptodate = 1;
avail[chosen_drive] = 1;
okcnt++;
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
/* If there are any other drives of the same vintage,
* add them in as well. We can't lose and we might gain
if (must_close) close(mdfd);
return 1;
}
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
for (i=0; i<bestcnt; i++) {
int j = best[i];
unsigned int desired_state;
info.disk.state = desired_state;
if (devices[j].uptodate &&
- st->ss->update_super(&info, super, "assemble", NULL, verbose, 0, NULL)) {
+ st->ss->update_super(st, &info, super, "assemble", NULL,
+ verbose, 0, NULL)) {
if (force) {
if (verbose >= 0)
fprintf(stderr, Name ": "
!enough(info.array.level, info.array.raid_disks,
info.array.layout, clean,
avail, okcnt)) {
- change += st->ss->update_super(&info, super, "force-array",
+ change += st->ss->update_super(st, &info, super, "force-array",
devices[chosen_drive].devname, verbose,
0, NULL);
clean = 1;
if (bitmap_file) {
int uuid[4];
- st->ss->uuid_from_super(uuid, super);
+ st->ss->uuid_from_super(st, uuid, super);
if (CreateBitmap(bitmap_file, force, (char*)uuid, bitmap_chunk,
delay, write_behind,
bitmapsize,
}
switch(pass){
case 1:
- st->ss->add_to_super(super, &disk);
+ st->ss->add_to_super(st, super, &disk);
break;
case 2:
if (disk.state == 1) break;
if (ioctl(mdfd, ADD_NEW_DISK, &disk)) {
fprintf(stderr, Name ": ADD_NEW_DISK for %s failed: %s\n",
dv->devname, strerror(errno));
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
return 1;
}
if (dv == moved_disk && dnum != insert_point) break;
}
}
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
/* param is not actually used */
if (runstop == 1 || subdevs >= raiddisks) {
int fd2 = dev_open(dv, O_RDONLY);
if (fd2 >=0 && st &&
st->ss->load_super(st, fd2, &super, NULL) == 0) {
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
if (info.array.ctime != array.ctime ||
info.array.level != array.level) {
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
super = NULL;
}
}
printf("MD_METADATA=%d.%d\n", array.major_version,
array.minor_version);
if (super)
- st->ss->export_super(super);
+ st->ss->export_super(st, super);
goto out;
}
} else if (e && e->percent >= 0)
printf("\n");
if (super && st)
- st->ss->detail_super(super, homehost);
+ st->ss->detail_super(st, super, homehost);
printf(" Number Major Minor RaidDevice State\n");
}
}
if (spares && brief) printf(" spares=%d", spares);
if (super && brief && st)
- st->ss->brief_detail_super(super);
+ st->ss->brief_detail_super(st, super);
if (super)
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
if (brief > 1 && devices) printf("\n devices=%s", devices);
if (brief) printf("\n");
continue;
if (SparcAdjust)
- st->ss->update_super(NULL, super, "sparc2.2", devlist->devname, 0, 0, NULL);
+ st->ss->update_super(st, NULL, super, "sparc2.2",
+ devlist->devname, 0, 0, NULL);
/* Ok, its good enough to try, though the checksum could be wrong */
if (brief) {
struct array *ap;
char *d;
for (ap=arrays; ap; ap=ap->next) {
- if (st->ss == ap->st->ss && st->ss->compare_super(&ap->super, super)==0)
+ if (st->ss == ap->st->ss &&
+ st->ss->compare_super(&ap->super, super)==0)
break;
}
if (!ap) {
ap->spares = 0;
ap->st = st;
arrays = ap;
- st->ss->getinfo_super(&ap->info, super);
+ st->ss->getinfo_super(st, &ap->info, super);
} else {
- st->ss->getinfo_super(&ap->info, super);
- st->ss->free_super(super);
+ st->ss->getinfo_super(st, &ap->info, super);
+ st->ss->free_super(st, super);
}
if (!(ap->info.disk.state & MD_DISK_SYNC))
ap->spares++;
dl_add(ap->devs, d);
} else {
printf("%s:\n",devlist->devname);
- st->ss->examine_super(super, homehost);
- st->ss->free_super(super);
+ st->ss->examine_super(st, super, homehost);
+ st->ss->free_super(st, super);
}
}
if (brief) {
for (ap=arrays; ap; ap=ap->next) {
char sep='=';
char *d;
- ap->st->ss->brief_examine_super(ap->super);
+ ap->st->ss->brief_examine_super(ap->st, ap->super);
if (ap->spares) printf(" spares=%d", ap->spares);
if (brief > 1) {
printf(" devices");
sep=',';
}
}
- ap->st->ss->free_super(ap->super);
+ ap->st->ss->free_super(ap->st, ap->super);
/* FIXME free ap */
if (ap->spares || brief > 1)
printf("\n");
return 1;
}
if (super)
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
super= NULL;
if (st->ss->load_super(st, fd2, &super, NULL)) {
fprintf(stderr, Name ": cannot find super block on %s\n", dv);
info.disk.minor = minor(stb.st_rdev);
info.disk.raid_disk = d;
info.disk.state = (1 << MD_DISK_SYNC) | (1 << MD_DISK_ACTIVE);
- st->ss->update_super(&info, super, "linear-grow-new", newdev,
+ st->ss->update_super(st, &info, super, "linear-grow-new", newdev,
0, 0, NULL);
if (st->ss->store_super(st, nfd, super)) {
info.array.active_disks = nd+1;
info.array.working_disks = nd+1;
- st->ss->update_super(&info, super, "linear-grow-update", dv,
+ st->ss->update_super(st, &info, super, "linear-grow-update", dv,
0, 0, NULL);
if (st->ss->store_super(st, fd2, super)) {
if (fd2 >= 0 &&
st->ss->load_super(st, fd2, &super, NULL) == 0) {
close(fd2);
- st->ss->uuid_from_super(uuid, super);
+ st->ss->uuid_from_super(st, uuid, super);
break;
}
close(fd2);
memcpy(bsb.magic, "md_backup_data-1", 16);
- st->ss->uuid_from_super((int*)&bsb.set_uuid, super);
+ st->ss->uuid_from_super(st, (int*)&bsb.set_uuid, super);
bsb.mtime = __cpu_to_le64(time(0));
bsb.arraystart = 0;
bsb.length = __cpu_to_le64(last_block);
if (st->ss->load_super(st, fd, &super, NULL))
continue;
- st->ss->getinfo_super(&dinfo, super);
- st->ss->free_super(super);
+ st->ss->getinfo_super(st, &dinfo, super);
+ st->ss->free_super(st, super);
super = NULL;
if (lseek64(fd,
(dinfo.data_offset + dinfo.component_size - 8) <<9,
if (st->ss->load_super(st, fdlist[j], &super, NULL))
/* FIXME should be this be an error */
continue;
- st->ss->getinfo_super(&dinfo, super);
- st->ss->free_super(super);
+ st->ss->getinfo_super(st, &dinfo, super);
+ st->ss->free_super(st, super);
super = NULL;
offsets[j] = dinfo.data_offset;
}
if (fdlist[j] < 0) continue;
if (st->ss->load_super(st, fdlist[j], &super, NULL))
continue;
- st->ss->getinfo_super(&dinfo, super);
+ st->ss->getinfo_super(st, &dinfo, super);
dinfo.reshape_progress = __le64_to_cpu(bsb.length);
- st->ss->update_super(&dinfo, super, "_reshape_progress",NULL,0, 0, NULL);
+ st->ss->update_super(st, &dinfo, super,
+ "_reshape_progress",
+ NULL,0, 0, NULL);
st->ss->store_super(st, fdlist[j], super);
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
}
/* And we are done! */
close(dfd);
return 1;
}
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
close (dfd);
/* 3/ Check if there is a match in mdadm.conf */
/* 3a/ if not, check for homehost match. If no match, reject. */
if (!match) {
if (homehost == NULL ||
- st->ss->match_home(super, homehost) == 0) {
+ st->ss->match_home(st, super, homehost) == 0) {
if (verbose >= 0)
fprintf(stderr, Name
": not found in mdadm.conf and not identified by homehost.\n");
return 2;
}
close(dfd2);
- st->ss->getinfo_super(&info2, super2);
+ st->ss->getinfo_super(st, &info2, super2);
if (info.array.level != info2.array.level ||
memcmp(info.uuid, info2.uuid, 16) != 0 ||
info.array.raid_disks != info2.array.raid_disks) {
close(dfd);
continue;
}
- st->ss->getinfo_super(&info, super);
- st->ss->free_super(super);
+ st->ss->getinfo_super(st, &info, super);
+ st->ss->free_super(st, super);
close(dfd);
if (info.disk.number != number ||
close(dfd);
if (ok != 0)
continue;
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
if (info.disk.state & (1<<MD_DISK_SYNC))
{
if (avail == NULL) {
if (avail[i])
avail[i]--;
avail[info.disk.raid_disk] = 2;
- st->ss->free_super(best_super);
+ st->ss->free_super(st, best_super);
best_super = super;
super = NULL;
} else { /* info.events much bigger */
cnt = 1; cnt1 = 0;
memset(avail, 0, info.disk.raid_disk);
max_events = info.events;
- st->ss->free_super(best_super);
+ st->ss->free_super(st, best_super);
best_super = super;
super = NULL;
}
}
if (super)
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
}
if (best_super) {
- st->ss->getinfo_super(bestinfo,best_super);
- st->ss->free_super(best_super);
+ st->ss->getinfo_super(st, bestinfo,best_super);
+ st->ss->free_super(st, best_super);
}
return cnt + cnt1;
}
close(dfd);
if (ok != 0)
continue;
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
if (md->devnum > 0)
path = map_dev(MD_MAJOR, md->devnum, 0);
else
map_add(&map, md->devnum, st->ss->major,
st->minor_version,
info.uuid, path ? : "/unknown");
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
break;
}
}
if (rv== 0 || (force && rv >= 2)) {
mdu_array_info_t info;
info.major_version = -1; /* zero superblock */
- st->ss->free_super(super);
+ st->ss->free_super(st, super);
st->ss->init_super(st, &super, &info, 0, "", NULL, NULL);
if (st->ss->store_super(st, fd, super)) {
if (!quiet)
* and was temporarily removed, and is now being re-added.
* If so, we can simply re-add it.
*/
- st->ss->uuid_from_super(duuid, dsuper);
+ st->ss->uuid_from_super(st, duuid, dsuper);
/* re-add doesn't work for version-1 superblocks
* before 2.6.18 :-(
get_linux_version() <= 2006018)
;
else if (osuper) {
- st->ss->uuid_from_super(ouuid, osuper);
+ st->ss->uuid_from_super(st, ouuid, osuper);
if (memcmp(duuid, ouuid, sizeof(ouuid))==0) {
/* looks close enough for now. Kernel
* will worry about whether a bitmap
* based reconstruction is possible.
*/
struct mdinfo mdi;
- st->ss->getinfo_super(&mdi, osuper);
+ st->ss->getinfo_super(st, &mdi, osuper);
disc.major = major(stb.st_rdev);
disc.minor = minor(stb.st_rdev);
disc.number = mdi.disk.number;
if (array.not_persistent==0) {
if (dv->writemostly)
disc.state |= 1 << MD_DISK_WRITEMOSTLY;
- st->ss->add_to_super(dsuper, &disc);
+ st->ss->add_to_super(st, dsuper, &disc);
if (st->ss->write_init_super(st, dsuper, &disc, dv->devname))
return 1;
} else if (dv->re_add) {
close(fd);
if (superror == 0) {
/* array might be active... */
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(st, &info, super);
if (st->ss->major == 0) {
mddev = get_md_name(info.array.md_minor);
disc.number = info.disk.number;
extern struct superswitch {
- void (*examine_super)(void *sbv, char *homehost);
- void (*brief_examine_super)(void *sbv);
- void (*detail_super)(void *sbv, char *homehost);
- void (*export_super)(void *sbv);
- void (*brief_detail_super)(void *sbv);
- void (*uuid_from_super)(int uuid[4], void *sbv);
- void (*getinfo_super)(struct mdinfo *info, void *sbv);
- int (*match_home)(void *sbv, char *homehost);
- int (*update_super)(struct mdinfo *info, void *sbv, char *update,
+ void (*examine_super)(struct supertype *st, void *sbv, char *homehost);
+ void (*brief_examine_super)(struct supertype *st, void *sbv);
+ void (*detail_super)(struct supertype *st, void *sbv, char *homehost);
+ void (*export_super)(struct supertype *st, void *sbv);
+ void (*brief_detail_super)(struct supertype *st, void *sbv);
+ void (*uuid_from_super)(struct supertype *st, int uuid[4], void *sbv);
+ void (*getinfo_super)(struct supertype *st, struct mdinfo *info, void *sbv);
+ int (*match_home)(struct supertype *st, void *sbv, char *homehost);
+ int (*update_super)(struct supertype *st, struct mdinfo *info,
+ void *sbv, char *update,
char *devname, int verbose,
int uuid_set, char *homehost);
int (*init_super)(struct supertype *st, void **sbp, mdu_array_info_t *info, unsigned long long size, char *name, char *homehost, int *uuid);
- void (*add_to_super)(void *sbv, mdu_disk_info_t *dinfo);
+ void (*add_to_super)(struct supertype *st, void *sbv, mdu_disk_info_t *dinfo);
int (*store_super)(struct supertype *st, int fd, void *sbv);
int (*write_init_super)(struct supertype *st, void *sbv, mdu_disk_info_t *dinfo, char *devname);
int (*compare_super)(void **firstp, void *secondv);
unsigned long long size, int may_change, int major);
void (*locate_bitmap)(struct supertype *st, int fd, void *sbv);
int (*write_bitmap)(struct supertype *st, int fd, void *sbv);
- void (*free_super)(void *super);
+ void (*free_super)(struct supertype *st, void *super);
int major;
int swapuuid; /* true if uuid is bigending rather than hostendian */
} super0, super1, *superlist[];
#ifndef MDASSEMBLE
-static void examine_super0(void *sbv, char *homehost)
+static void examine_super0(struct supertype *st, void *sbv, char *homehost)
{
mdp_super_t *sb = sbv;
time_t atime;
}
}
-static void brief_examine_super0(void *sbv)
+static void brief_examine_super0(struct supertype *st, void *sbv)
{
mdp_super_t *sb = sbv;
char *c=map_num(pers, sb->level);
printf("\n");
}
-static void detail_super0(void *sbv, char *homehost)
+static void detail_super0(struct supertype *st, void *sbv, char *homehost)
{
mdp_super_t *sb = sbv;
printf(" UUID : ");
printf("\n Events : %d.%d\n\n", sb->events_hi, sb->events_lo);
}
-static void brief_detail_super0(void *sbv)
+static void brief_detail_super0(struct supertype *st, void *sbv)
{
mdp_super_t *sb = sbv;
printf(" UUID=");
printf("%08x", sb->set_uuid0);
}
-static void export_super0(void *sbv)
+static void export_super0(struct supertype *st, void *sbv)
{
mdp_super_t *sb = sbv;
printf("MD_UUID=");
}
#endif
-static int match_home0(void *sbv, char *homehost)
+static int match_home0(struct supertype *st, void *sbv, char *homehost)
{
mdp_super_t *sb = sbv;
char buf[20];
return (memcmp(&sb->set_uuid2, hash, 8)==0);
}
-static void uuid_from_super0(int uuid[4], void * sbv)
+static void uuid_from_super0(struct supertype *st, int uuid[4], void * sbv)
{
mdp_super_t *super = sbv;
uuid[0] = super->set_uuid0;
}
}
-static void getinfo_super0(struct mdinfo *info, void *sbv)
+static void getinfo_super0(struct supertype *st, struct mdinfo *info, void *sbv)
{
mdp_super_t *sb = sbv;
int working = 0;
info->events = md_event(sb);
info->data_offset = 0;
- uuid_from_super0(info->uuid, sbv);
+ uuid_from_super0(st, info->uuid, sbv);
if (sb->minor_version > 90 && (sb->reshape_position+1) != 0) {
info->reshape_active = 1;
}
-static int update_super0(struct mdinfo *info, void *sbv, char *update,
+static int update_super0(struct supertype *st, struct mdinfo *info,
+ void *sbv, char *update,
char *devname, int verbose,
int uuid_set, char *homehost)
{
if (sb->state & (1<<MD_SB_BITMAP_PRESENT)) {
struct bitmap_super_s *bm;
bm = (struct bitmap_super_s*)(sb+1);
- uuid_from_super0((int*)bm->uuid, sbv);
+ uuid_from_super0(st, (int*)bm->uuid, sbv);
}
}
if (strcmp(update, "_reshape_progress")==0)
}
/* Add a device to the superblock being created */
-static void add_to_super0(void *sbv, mdu_disk_info_t *dinfo)
+static void add_to_super0(struct supertype *st, void *sbv, mdu_disk_info_t *dinfo)
{
mdp_super_t *sb = sbv;
mdp_disk_t *dk = &sb->disks[dinfo->number];
return 0;
}
- uuid_from_super0(uuid1, first);
- uuid_from_super0(uuid2, second);
+ uuid_from_super0(NULL, uuid1, first);
+ uuid_from_super0(NULL, uuid2, second);
if (!same_uuid(uuid1, uuid2, 0))
return 2;
if (first->major_version != second->major_version ||
!= sizeof(struct bitmap_super_s))
goto no_bitmap;
- uuid_from_super0(uuid, super);
+ uuid_from_super0(st, uuid, super);
bsb = (struct bitmap_super_s *)(super+1);
if (__le32_to_cpu(bsb->magic) != BITMAP_MAGIC ||
memcmp(bsb->uuid, uuid, 16) != 0)
memset(bms, 0, sizeof(*bms));
bms->magic = __cpu_to_le32(BITMAP_MAGIC);
bms->version = __cpu_to_le32(major);
- uuid_from_super0((int*)bms->uuid, sb);
+ uuid_from_super0(st, (int*)bms->uuid, sb);
bms->chunksize = __cpu_to_le32(chunk);
bms->daemon_sleep = __cpu_to_le32(delay);
bms->sync_size = __cpu_to_le64(size);
return rv;
}
-static void free_super0(void *super)
+static void free_super0(struct supertype *st, void *super)
{
if (super)
free(super);
}
#ifndef MDASSEMBLE
-static void examine_super1(void *sbv, char *homehost)
+static void examine_super1(struct supertype *st, void *sbv, char *homehost)
{
struct mdp_superblock_1 *sb = sbv;
time_t atime;
}
-static void brief_examine_super1(void *sbv)
+static void brief_examine_super1(struct supertype *st, void *sbv)
{
struct mdp_superblock_1 *sb = sbv;
int i;
printf("\n");
}
-static void detail_super1(void *sbv, char *homehost)
+static void detail_super1(struct supertype *st, void *sbv, char *homehost)
{
struct mdp_superblock_1 *sb = sbv;
int i;
printf("\n Events : %llu\n\n", (unsigned long long)__le64_to_cpu(sb->events));
}
-static void brief_detail_super1(void *sbv)
+static void brief_detail_super1(struct supertype *st, void *sbv)
{
struct mdp_superblock_1 *sb = sbv;
int i;
}
}
-static void export_super1(void *sbv)
+static void export_super1(struct supertype *st, void *sbv)
{
struct mdp_superblock_1 *sb = sbv;
int i;
#endif
-static int match_home1(void *sbv, char *homehost)
+static int match_home1(struct supertype *st, void *sbv, char *homehost)
{
struct mdp_superblock_1 *sb = sbv;
int l = homehost ? strlen(homehost) : 0;
strncmp(sb->set_name, homehost, l) == 0);
}
-static void uuid_from_super1(int uuid[4], void * sbv)
+static void uuid_from_super1(struct supertype *st, int uuid[4], void * sbv)
{
struct mdp_superblock_1 *super = sbv;
char *cuuid = (char*)uuid;
cuuid[i] = super->set_uuid[i];
}
-static void getinfo_super1(struct mdinfo *info, void *sbv)
+static void getinfo_super1(struct supertype *st, struct mdinfo *info, void *sbv)
{
struct mdp_superblock_1 *sb = sbv;
int working = 0;
info->array.working_disks = working;
}
-static int update_super1(struct mdinfo *info, void *sbv, char *update,
+static int update_super1(struct supertype *st, struct mdinfo *info,
+ void *sbv, char *update,
char *devname, int verbose,
int uuid_set, char *homehost)
{
}
/* Add a device to the superblock being created */
-static void add_to_super1(void *sbv, mdu_disk_info_t *dk)
+static void add_to_super1(struct supertype *st, void *sbv, mdu_disk_info_t *dk)
{
struct mdp_superblock_1 *sb = sbv;
__u16 *rp = sb->dev_roles + dk->number;
!= sizeof(struct bitmap_super_s))
goto no_bitmap;
- uuid_from_super1(uuid, super);
+ uuid_from_super1(st, uuid, super);
if (__le32_to_cpu(bsb->magic) != BITMAP_MAGIC ||
memcmp(bsb->uuid, uuid, 16) != 0)
goto no_bitmap;
memset(bms, 0, sizeof(*bms));
bms->magic = __cpu_to_le32(BITMAP_MAGIC);
bms->version = __cpu_to_le32(major);
- uuid_from_super1((int*)bms->uuid, sb);
+ uuid_from_super1(st, (int*)bms->uuid, sb);
bms->chunksize = __cpu_to_le32(chunk);
bms->daemon_sleep = __cpu_to_le32(delay);
bms->sync_size = __cpu_to_le64(size);
return rv;
}
-static void free_super1(void *super)
+static void free_super1(struct supertype *st, void *super)
{
if (super)
free(super);
/* Looks like a raid array .. */
fprintf(stderr, Name ": %s appears to be part of a raid array:\n",
name);
- st->ss->getinfo_super(&info, super);
- st->ss->free_super(super);
+ st->ss->getinfo_super(st, &info, super);
+ st->ss->free_super(st, super);
crtime = info.array.ctime;
level = map_num(pers, info.array.level);
if (!level) level = "-unknown-";
rv = ss->load_super(st, fd, &sbp, NULL);
if (rv == 0) {
struct mdinfo info;
- ss->getinfo_super(&info, sbp);
+ st->ss->getinfo_super(st, &info, sbp);
if (bestsuper == -1 ||
besttime < info.array.ctime) {
bestsuper = i;