summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-05-27 09:18:55 +1000
committerNeil Brown <neilb@suse.de>2008-05-27 09:18:55 +1000
commit159c3a1a7785693d21f5226182f9c066882bef66 (patch)
tree60eb38558c53783bcf7c2b7a6cdf387880c1c58d /super-intel.c
parented9d66aadec7ae41751e3a95352628814b47fbad (diff)
downloadmdadm-159c3a1a7785693d21f5226182f9c066882bef66.tar.gz
mdadm-159c3a1a7785693d21f5226182f9c066882bef66.tar.xz
mdadm-159c3a1a7785693d21f5226182f9c066882bef66.zip
Remove st->text_version in favour of info->text_version
I want the metadata handler to have more control over the 'version', particularly for arrays which are members of containers. So discard st->text_version and instead use info->text_version which getinfo_super can initialise.
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c
index edfcae8..69aef65 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -443,11 +443,17 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info)
info->disk.state |= s & FAILED_DISK ? (1 << MD_DISK_FAULTY) : 0;
info->disk.state |= s & USABLE_DISK ? (1 << MD_DISK_SYNC) : 0;
info->reshape_active = 0;
+
+ strcpy(info->text_version, "imsm");
}
static void getinfo_super_imsm_raid(struct supertype *st, struct mdinfo *info)
{
printf("%s\n", __FUNCTION__);
+
+ sprintf(info->text_version, "/%s/%d",
+ devnum2devname(st->container_dev),
+ info->container_member); // FIXME is this even set here?
}
static int update_super_imsm(struct supertype *st, struct mdinfo *info,
@@ -1063,6 +1069,10 @@ static struct mdinfo *container_content_imsm(struct supertype *st)
strncpy(this->name, (char *) dev->volume, MAX_RAID_SERIAL_LEN);
this->name[MAX_RAID_SERIAL_LEN] = 0;
+ sprintf(this->text_version, "/%s/%d",
+ devnum2devname(st->container_dev),
+ this->container_member);
+
memset(this->uuid, 0, sizeof(this->uuid));
sz = __le32_to_cpu(dev->size_high);
@@ -1352,7 +1362,6 @@ struct superswitch super_imsm = {
.major = 2000,
.swapuuid = 0,
.external = 1,
- .text_version = "imsm",
/* for mdmon */
.open_new = imsm_open_new,
@@ -1389,7 +1398,6 @@ struct superswitch super_imsm_container = {
.major = 2000,
.swapuuid = 0,
.external = 1,
- .text_version = "imsm",
};
struct superswitch super_imsm_raid = {
@@ -1409,5 +1417,4 @@ struct superswitch super_imsm_raid = {
.major = 2001,
.swapuuid = 0,
.external = 2,
- .text_version = "imsm",
};