]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Query.c
Add mbr pseudo metadata handler.
[thirdparty/mdadm.git] / Query.c
diff --git a/Query.c b/Query.c
index e1743ef3685e7d79233b71b4315dd2ccfdbf1fa2..8847be7ec0b6a1e0880865d672b38f9f0374d2e2 100644 (file)
--- a/Query.c
+++ b/Query.c
@@ -1,7 +1,7 @@
 /*
  * mdadm - manage Linux "md" devices aka RAID arrays.
  *
- * Copyright (C) 2002-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2002-2009 Neil Brown <neilb@suse.de>
  *
  *
  *    This program is free software; you can redistribute it and/or modify
  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  *    Author: Neil Brown
- *    Email: <neilb@cse.unsw.edu.au>
- *    Paper: Neil Brown
- *           School of Computer Science and Engineering
- *           The University of New South Wales
- *           Sydney, 2052
- *           Australia
+ *    Email: <neilb@suse.de>
  */
 
 #include       "mdadm.h"
@@ -37,13 +32,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 +83,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(&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 +116,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;