]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Query.c
Merge branch 'master' in devel-3.0
[thirdparty/mdadm.git] / Query.c
diff --git a/Query.c b/Query.c
index 19b2ce5e621c226445003cb5ec631b6b0371142b..dc69eb8271ec171c35a418bf883b52cfacb04b6d 100644 (file)
--- a/Query.c
+++ b/Query.c
@@ -37,13 +37,12 @@ int Query(char *dev)
         * whether it is an md device and whether it has
         * a superblock
         */
-       int fd = open(dev, O_RDONLY, 0);
+       int fd = open(dev, O_RDONLY);
        int vers;
        int ioctlerr;
        int superror, superrno;
        struct mdinfo info;
        mdu_array_info_t array;
-       void *super;
        struct supertype *st = NULL;
 
        unsigned long long larray_size;
@@ -89,15 +88,15 @@ int Query(char *dev)
        }
        st = guess_super(fd);
        if (st) {
-               superror = st->ss->load_super(st, fd, &super, dev);
+               superror = st->ss->load_super(st, fd, dev);
                superrno = errno;
        } else
                superror = -1;
        close(fd);
        if (superror == 0) {
                /* array might be active... */
-               st->ss->getinfo_super(st, &info, super);
-               if (st->ss->major == 0) {
+               st->ss->getinfo_super(st, &info);
+               if (st->ss == &super0) {
                        mddev = get_md_name(info.array.md_minor);
                        disc.number = info.disk.number;
                        activity = "undetected";
@@ -122,7 +121,7 @@ int Query(char *dev)
                       activity,
                       map_num(pers, info.array.level),
                       mddev);
-               if (st->ss->major == 0)
+               if (st->ss == &super0)
                        put_md_name(mddev);
        }
        return 0;