From f9ce90ba509d0b624cc38635861b9c27550fbefc Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 3 May 2005 23:44:32 +0000 Subject: 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 --- Query.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Query.c') diff --git a/Query.c b/Query.c index 71aafd8..88df321 100644 --- a/Query.c +++ b/Query.c @@ -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"; -- cgit