one_comp->obj.id = oid;
exofs_make_credential(one_comp->cred, &one_comp->obj);
+ oc->first_dev = 0;
oc->numdevs = sbi->layout.group_width * sbi->layout.mirrors_p1 *
sbi->layout.group_count;
oc->single_comp = EC_SINGLE_COMP;
static struct osd_dev *_ios_od(struct ore_io_state *ios, unsigned index)
{
+ ORE_DBGMSG2("oc->first_dev=%d oc->numdevs=%d i=%d oc->ods=%p\n",
+ ios->oc->first_dev, ios->oc->numdevs, index,
+ ios->oc->ods);
+
return ore_comp_dev(ios->oc, index);
}
};
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
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 {