Add a 'name' field to 'info' to compensate.
Signed-off-by: Neil Brown <neilb@suse.de>
unsigned int num_devs;
mddev_dev_t tmpdev;
struct mdinfo info;
- struct mddev_ident_s ident2;
char *avail;
int nextspare = 0;
fprintf( stderr, Name ": no RAID superblock on %s\n",
devname);
} else {
- tst->ss->getinfo_super(&info, &ident2, super);
+ tst->ss->getinfo_super(&info, super);
}
if (dfd >= 0) close(dfd);
continue;
}
if (ident->name[0] &&
- (!super || strncmp(ident2.name, ident->name, 32)!=0)) {
+ (!super || strncmp(info.name, ident->name, 32)!=0)) {
if ((inargv && verbose >= 0) || verbose > 0)
fprintf(stderr, Name ": %s has wrong name.\n",
devname);
return 1;
}
- st->ss->getinfo_super(&info, &ident2, first_super);
+ st->ss->getinfo_super(&info, first_super);
/* now we have some devices that might be suitable.
* I wonder how many
fprintf(stderr, Name ": No suitable drives found for %s\n", mddev);
return 1;
}
- st->ss->getinfo_super(&info, &ident2, super);
+ st->ss->getinfo_super(&info, super);
for (i=0; i<bestcnt; i++) {
int j = best[i];
unsigned int desired_state;
backup after a crash.
- Put a 'canary' at each end of the backup so a corruption
can be more easily detected.
+ - Remove useless 'ident' arguement from ->getinfo_super method.
Changes Prior to 2.3.1 release
- Fixed -O2 compile so I could make and RPM.
if (fd2 >=0 && st &&
st->ss->load_super(st, fd2, &super, NULL) == 0) {
struct mdinfo info;
- struct mddev_ident_s ident;
- st->ss->getinfo_super(&info, &ident, super);
+ st->ss->getinfo_super(&info, super);
if (info.array.ctime != array.ctime ||
info.array.level != array.level) {
free(super);
void *super;
struct supertype *st;
struct mdinfo info;
- struct mddev_ident_s ident;
void *devs;
struct array *next;
int spares;
ap->spares = 0;
ap->st = st;
arrays = ap;
- st->ss->getinfo_super(&ap->info, &ap->ident, super);
+ st->ss->getinfo_super(&ap->info, super);
} else {
- st->ss->getinfo_super(&ap->info, &ap->ident, super);
+ st->ss->getinfo_super(&ap->info, super);
free(super);
}
if (!(ap->info.disk.state & MD_DISK_SYNC))
for (i=old_disks; i<cnt; i++) {
void *super = NULL;
struct mdinfo dinfo;
- struct mddev_ident_s id;
struct mdp_backup_super bsb;
char buf[4096];
if (st->ss->load_super(st, fdlist[i], &super, NULL))
continue;
- st->ss->getinfo_super(&dinfo, &id, super);
+ st->ss->getinfo_super(&dinfo, super);
free(super); super = NULL;
if (lseek64(fdlist[i],
(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, &id, super);
+ st->ss->getinfo_super(&dinfo, super);
free(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, &id, super);
+ st->ss->getinfo_super(&dinfo, super);
dinfo.reshape_progress = __le64_to_cpu(bsb.length);
st->ss->update_super(&dinfo, super, "_reshape_progress",NULL,0);
st->ss->store_super(st, fdlist[j], super);
* based reconstruct is possible
*/
struct mdinfo mdi;
- struct mddev_ident_s ident;
- st->ss->getinfo_super(&mdi, &ident, osuper);
+ st->ss->getinfo_super(&mdi, osuper);
disc.major = major(stb.st_rdev);
disc.minor = minor(stb.st_rdev);
disc.number = mdi.disk.number;
int ioctlerr;
int superror, superrno;
struct mdinfo info;
- struct mddev_ident_s ident;
mdu_array_info_t array;
void *super;
struct supertype *st = NULL;
close(fd);
if (superror == 0) {
/* array might be active... */
- st->ss->getinfo_super(&info, &ident, super);
+ st->ss->getinfo_super(&info, super);
if (st->ss->major == 0) {
mddev = get_md_name(info.array.md_minor);
disc.number = info.disk.number;
mdu_disk_info_t disk;
__u64 events;
int uuid[4];
+ char name[33];
unsigned long long data_offset;
unsigned long long component_size;
int reshape_active;
void (*detail_super)(void *sbv);
void (*brief_detail_super)(void *sbv);
void (*uuid_from_super)(int uuid[4], void *sbv);
- void (*getinfo_super)(struct mdinfo *info, mddev_ident_t ident, void *sbv);
+ void (*getinfo_super)(struct mdinfo *info, void *sbv);
int (*update_super)(struct mdinfo *info, void *sbv, char *update, char *devname, int verbose);
__u64 (*event_super)(void *sbv);
int (*init_super)(struct supertype *st, void **sbp, mdu_array_info_t *info, unsigned long long size, char *name);
}
}
-static void getinfo_super0(struct mdinfo *info, mddev_ident_t ident, void *sbv)
+static void getinfo_super0(struct mdinfo *info, void *sbv)
{
mdp_super_t *sb = sbv;
int working = 0;
} else
info->reshape_active = 0;
- ident->name[0] = 0;
+ info->name[0] = 0;
/* work_disks is calculated rather than read directly */
for (i=0; i < MD_SB_DISKS; i++)
if ((sb->disks[i].state & (1<<MD_DISK_SYNC)) &&
cuuid[i] = super->set_uuid[i];
}
-static void getinfo_super1(struct mdinfo *info, mddev_ident_t ident, void *sbv)
+static void getinfo_super1(struct mdinfo *info, void *sbv)
{
struct mdp_superblock_1 *sb = sbv;
int working = 0;
memcpy(info->uuid, sb->set_uuid, 16);
- strncpy(ident->name, sb->set_name, 32);
- ident->name[32] = 0;
+ strncpy(info->name, sb->set_name, 32);
+ info->name[32] = 0;
if (sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE)) {
info->reshape_active = 1;
{
void *super;
struct mdinfo info;
- struct mddev_ident_s ident;
time_t crtime;
char *level;
struct supertype *st = guess_super(fd);
/* Looks like a raid array .. */
fprintf(stderr, Name ": %s appears to be part of a raid array:\n",
name);
- st->ss->getinfo_super(&info, &ident, super);
+ st->ss->getinfo_super(&info, super);
free(super);
crtime = info.array.ctime;
level = map_num(pers, info.array.level);
rv = ss->load_super(st, fd, &sbp, NULL);
if (rv == 0) {
struct mdinfo info;
- struct mddev_ident_s ident;
- ss->getinfo_super(&info, &ident, sbp);
+ ss->getinfo_super(&info, sbp);
if (bestsuper == -1 ||
besttime < info.array.ctime) {
bestsuper = i;