summaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/osd_ore.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
index baeef0200a1f..492b70d43bb6 100644
--- a/include/scsi/osd_ore.h
+++ b/include/scsi/osd_ore.h
@@ -49,6 +49,7 @@ struct ore_dev {
};
struct ore_components {
+ unsigned first_dev; /* First logical device no */
unsigned numdevs; /* Num of devices in array */
/* If @single_comp == EC_SINGLE_COMP, @comps points to a single
* component. else there are @numdevs components
@@ -70,14 +71,14 @@ struct ore_components {
static inline struct osd_dev *ore_comp_dev(
const struct ore_components *oc, unsigned i)
{
- BUG_ON(oc->numdevs <= i);
- return oc->ods[i]->od;
+ BUG_ON((i < oc->first_dev) || (oc->first_dev + oc->numdevs <= i));
+ return oc->ods[i - oc->first_dev]->od;
}
static inline void ore_comp_set_dev(
struct ore_components *oc, unsigned i, struct osd_dev *od)
{
- oc->ods[i]->od = od;
+ oc->ods[i - oc->first_dev]->od = od;
}
struct ore_striping_info {