diff options
author | Neil Brown <neilb@suse.de> | 2006-05-19 07:19:04 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-05-19 07:19:04 +0000 |
commit | a1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0 (patch) | |
tree | 96ccd12c23643ef4ba48ab6c8768cf7ce75628e6 /super1.c | |
parent | b6750aa8da57bfc0eb3a3bdc47c289638b1022c8 (diff) | |
download | mdadm-a1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0.tar.gz mdadm-a1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0.tar.xz mdadm-a1cbd7d053e034bbfcf337bc9ee7b92ec4c6f6c0.zip |
Include homehost information in --examine as appropriate
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r-- | super1.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -136,7 +136,7 @@ static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb) } #ifndef MDASSEMBLE -static void examine_super1(void *sbv) +static void examine_super1(void *sbv, char *homehost) { struct mdp_superblock_1 *sb = sbv; time_t atime; @@ -144,6 +144,7 @@ static void examine_super1(void *sbv) int faulty; int i; char *c; + int l = homehost ? strlen(homehost) : 0; printf(" Magic : %08x\n", __le32_to_cpu(sb->magic)); printf(" Version : %02d\n", 1); @@ -154,8 +155,12 @@ static void examine_super1(void *sbv) printf("%02x", sb->set_uuid[i]); } printf("\n"); - printf(" Name : %.32s\n", sb->set_name); - + printf(" Name : %.32s", sb->set_name); + if (l > 0 && l < 32 && + sb->set_name[l] == ':' && + strncmp(sb->set_name, homehost, l) == 0) + printf(" (local to host %s)", homehost); + printf("\n"); atime = __le64_to_cpu(sb->ctime) & 0xFFFFFFFFFFULL; printf(" Creation Time : %.24s\n", ctime(&atime)); c=map_num(pers, __le32_to_cpu(sb->level)); |