diff options
author | Pawel Baldysiak <pawel.baldysiak@intel.com> | 2015-04-08 11:42:18 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-04-09 09:06:23 +1000 |
commit | 72a45777041901f37d187920d03462ee6d5e655f (patch) | |
tree | 80e2c5971f6aa6060a02cb3e6cae082eab26a862 /platform-intel.c | |
parent | 87af7267bd07599c89e3b0ef2f4ef7220640991c (diff) | |
download | mdadm-72a45777041901f37d187920d03462ee6d5e655f.tar.gz |
IMSM: Count arrays per orom
Active arrays with IMSM metadata are counted per hba so far.
This is bad due to new functionality of orom shared between multiple
controllers i.e. more arrays can be created than is supported by orom.
This patch changes the way of counting arrays, so the result will be
sum of arrays under every hba supported by specific orom.
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'platform-intel.c')
-rw-r--r-- | platform-intel.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/platform-intel.c b/platform-intel.c index 1e9ddcd..edb8679 100644 --- a/platform-intel.c +++ b/platform-intel.c @@ -233,7 +233,7 @@ struct pciExpDataStructFormat { struct orom_entry *orom_entries; -const struct imsm_orom *get_orom_by_device_id(__u16 dev_id) +const struct orom_entry *get_orom_entry_by_device_id(__u16 dev_id) { struct orom_entry *entry; struct devid_list *devid; @@ -241,13 +241,23 @@ const struct imsm_orom *get_orom_by_device_id(__u16 dev_id) for (entry = orom_entries; entry; entry = entry->next) { for (devid = entry->devid_list; devid; devid = devid->next) { if (devid->devid == dev_id) - return &entry->orom; + return entry; } } return NULL; } +const struct imsm_orom *get_orom_by_device_id(__u16 dev_id) +{ + const struct orom_entry *entry = get_orom_entry_by_device_id(dev_id); + + if (entry) + return &entry->orom; + + return NULL; +} + static struct orom_entry *add_orom(const struct imsm_orom *orom) { struct orom_entry *list; |