diff options
author | Neil Brown <neilb@suse.de> | 2005-05-04 01:44:32 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-05-04 01:44:32 +0200 |
commit | f9ce90ba509d0b624cc38635861b9c27550fbefc (patch) | |
tree | de5576f6c939e0fd95f76030b4d273fdfc9f5945 /Query.c | |
parent | Separate sueprblock handling into separate file (diff) | |
download | mdadm-f9ce90ba509d0b624cc38635861b9c27550fbefc.tar.xz mdadm-f9ce90ba509d0b624cc38635861b9c27550fbefc.zip |
Add a 'super-switch' so that different format superblocks can be used.
This includes:
adding --metadata= option to choose metadata format
adding metadata= word to config file.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'Query.c')
-rw-r--r-- | Query.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -44,6 +44,7 @@ int Query(char *dev) struct mdinfo info; mdu_array_info_t array; void *super; + struct superswitch *ss = NULL; unsigned long long larray_size; unsigned long array_size; @@ -94,12 +95,16 @@ int Query(char *dev) array.raid_disks, array.spare_disks, array.spare_disks==1?"":"s"); } - superror = load_super0(fd, &super, dev); - superrno = errno; + ss = guess_super(fd, dev); + if (ss) { + superror = ss->load_super(fd, &super, dev); + superrno = errno; + } else + superror = -1; close(fd); if (superror == 0) { /* array might be active... */ - getinfo_super0(&info, super); + ss->getinfo_super(&info, super); mddev = get_md_name(info.array.md_minor); disc.number = info.disk.number; activity = "undetected"; |