summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-05-04 01:44:32 +0200
committerNeil Brown <neilb@suse.de>2005-05-04 01:44:32 +0200
commitf9ce90ba509d0b624cc38635861b9c27550fbefc (patch)
treede5576f6c939e0fd95f76030b4d273fdfc9f5945 /Detail.c
parentSeparate sueprblock handling into separate file (diff)
downloadmdadm-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 'Detail.c')
-rw-r--r--Detail.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/Detail.c b/Detail.c
index 59b091fe..2f3fc7ff 100644
--- a/Detail.c
+++ b/Detail.c
@@ -50,6 +50,7 @@ int Detail(char *dev, int brief, int test)
int is_26 = get_linux_version() >= 2006000;
int is_rebuilding = 0;
int failed = 0;
+ struct superswitch *ss = NULL;
void *super = NULL;
int rv = test ? 4 : 1;
@@ -82,6 +83,8 @@ int Detail(char *dev, int brief, int test)
close(fd);
return rv;
}
+ ss = super_by_version(array.major_version);
+
if (fstat(fd, &stb) != 0 && !S_ISBLK(stb.st_mode))
stb.st_rdev = 0;
rv = 0;
@@ -103,10 +106,10 @@ int Detail(char *dev, int brief, int test)
* to get more info
*/
int fd2 = open(dv, O_RDONLY);
- if (fd2 >=0 &&
- load_super0(fd2, &super, NULL) == 0) {
+ if (fd2 >=0 && ss &&
+ ss->load_super(fd2, &super, NULL) == 0) {
struct mdinfo info;
- getinfo_super0(&info, super);
+ ss->getinfo_super(&info, super);
if (info.array.ctime != array.ctime ||
info.array.level != array.level) {
free(super);
@@ -202,8 +205,8 @@ int Detail(char *dev, int brief, int test)
}
free_mdstat(ms);
- if (super)
- detail_super0(super);
+ if (super && ss)
+ ss->detail_super(super);
printf(" Number Major Minor RaidDevice State\n");
}
@@ -275,8 +278,8 @@ int Detail(char *dev, int brief, int test)
if (!brief) printf("\n");
}
if (spares && brief) printf(" spares=%d", spares);
- if (super && brief)
- brief_detail_super0(super);
+ if (super && brief && ss)
+ ss->brief_detail_super(super);
if (brief && devices) printf("\n devices=%s", devices);
if (brief) printf("\n");