]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Remove ident arg from getinfo_super;
authorNeil Brown <neilb@suse.de>
Mon, 27 Mar 2006 04:34:38 +0000 (04:34 +0000)
committerNeil Brown <neilb@suse.de>
Mon, 27 Mar 2006 04:34:38 +0000 (04:34 +0000)
Add a 'name' field to 'info' to compensate.

Signed-off-by: Neil Brown <neilb@suse.de>
Assemble.c
ChangeLog
Detail.c
Examine.c
Grow.c
Manage.c
Query.c
mdadm.h
super0.c
super1.c
util.c

index 2dca21df996db335f2120f9c3293ed9552688a4c..a8a331e1d6901b74cbf257880fd15be6ffa9e0e3 100644 (file)
@@ -117,7 +117,6 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
        unsigned int num_devs;
        mddev_dev_t tmpdev;
        struct mdinfo info;
-       struct mddev_ident_s ident2;
        char *avail;
        int nextspare = 0;
        
@@ -215,7 +214,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                                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);
 
@@ -227,7 +226,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                        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);
@@ -374,7 +373,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                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
@@ -500,7 +499,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                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;
index ade4debb9b111ce89e7179dd0a3efac78be9aa75..22a97ccd0b19c3f69335ee2f8538c9256c3829f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ Changes Prior to 2.4 release
        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.
index 774a75095bad055ca3885d26a8604209dd6e27a0..15c751f82f2b820381cdc459649d508ae0ab3d19 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -114,8 +114,7 @@ int Detail(char *dev, int brief, int test)
                                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);
index fcfb02b8d006a1d707758f6247f84e4201b4c0a3..b4425e5a9d5f9d9f10f3377ef992992be1ba0355 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -62,7 +62,6 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust, struct su
                void *super;
                struct supertype *st;
                struct mdinfo info;
-               struct mddev_ident_s ident;
                void *devs;
                struct array *next;
                int spares;
@@ -113,9 +112,9 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust, struct su
                                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))
diff --git a/Grow.c b/Grow.c
index 44329228ad5ef6a8d35403b64fdf6c2aea1e81bd..04de4550608ed7918ec940401d46dd336daa4ac9 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -835,7 +835,6 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
        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];
 
@@ -851,7 +850,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
                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,
@@ -893,7 +892,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
                        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;
                }
@@ -916,7 +915,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
                        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);
index 67e72107f4b97c1e2aacc114a75587e3ec957918..f7f3f6effe4f41ae58d0105f3fe2c7e85e830cee 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -278,8 +278,7 @@ int Manage_subdevs(char *devname, int fd,
                                                 * 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;
diff --git a/Query.c b/Query.c
index a76c69204e98f3c65274486dfc06d4622112599a..d2bfb0524672cacab8ed31add6ca5480afbb376a 100644 (file)
--- a/Query.c
+++ b/Query.c
@@ -42,7 +42,6 @@ int Query(char *dev)
        int ioctlerr;
        int superror, superrno;
        struct mdinfo info;
-       struct mddev_ident_s ident;
        mdu_array_info_t array;
        void *super;
        struct supertype *st = NULL;
@@ -105,7 +104,7 @@ int Query(char *dev)
        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;
diff --git a/mdadm.h b/mdadm.h
index 00c280b35572d2448c2170c540c752b9cf0c3f0a..c929be95eccf7eebbc304572b037e11cdd78e6c9 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -91,6 +91,7 @@ struct mdinfo {
        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;
@@ -254,7 +255,7 @@ extern struct superswitch {
        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);
index 99d09a437d5d144695ce24baae3787262755b996..c7f2f613e2ec81aae244c6aa31962623b33fb45c 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -265,7 +265,7 @@ static void uuid_from_super0(int uuid[4], void * sbv)
        }
 }
 
-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;
@@ -304,7 +304,7 @@ static void getinfo_super0(struct mdinfo *info, mddev_ident_t ident, void *sbv)
        } 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)) &&
index 4df637004be7cfea651cc18cd4a3e7eaffe2cf3f..38b53e7d88121c93013ad0b5ed99a4fd63abbd95 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -353,7 +353,7 @@ static void uuid_from_super1(int uuid[4], void * sbv)
                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;
@@ -399,8 +399,8 @@ static void getinfo_super1(struct mdinfo *info, mddev_ident_t ident, void *sbv)
 
        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;
diff --git a/util.c b/util.c
index 0af433130bb723dcf4943a865cebda0f7f8e5553..ff175009ec8624a2e50fe1d8699a1590cd6e18fb 100644 (file)
--- a/util.c
+++ b/util.c
@@ -248,7 +248,6 @@ int check_raid(int fd, char *name)
 {
        void *super;
        struct mdinfo info;
-       struct mddev_ident_s ident;
        time_t crtime;
        char *level;
        struct supertype *st = guess_super(fd);
@@ -258,7 +257,7 @@ int check_raid(int fd, char *name)
        /* 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);
@@ -653,8 +652,7 @@ struct supertype *guess_super(int fd)
                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;