diff options
-rw-r--r-- | fs/exofs/exofs.h | 1 | ||||
-rw-r--r-- | fs/exofs/ore.c | 4 | ||||
-rw-r--r-- | include/scsi/osd_ore.h | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h index 006fd6f33571..51f4b4c40f09 100644 --- a/fs/exofs/exofs.h +++ b/fs/exofs/exofs.h | |||
@@ -217,6 +217,7 @@ static inline void exofs_init_comps(struct ore_components *oc, | |||
217 | one_comp->obj.id = oid; | 217 | one_comp->obj.id = oid; |
218 | exofs_make_credential(one_comp->cred, &one_comp->obj); | 218 | exofs_make_credential(one_comp->cred, &one_comp->obj); |
219 | 219 | ||
220 | oc->first_dev = 0; | ||
220 | oc->numdevs = sbi->layout.group_width * sbi->layout.mirrors_p1 * | 221 | oc->numdevs = sbi->layout.group_width * sbi->layout.mirrors_p1 * |
221 | sbi->layout.group_count; | 222 | sbi->layout.group_count; |
222 | oc->single_comp = EC_SINGLE_COMP; | 223 | oc->single_comp = EC_SINGLE_COMP; |
diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c index 8354fe061d1c..f1b718028a1f 100644 --- a/fs/exofs/ore.c +++ b/fs/exofs/ore.c | |||
@@ -62,6 +62,10 @@ static struct osd_obj_id *_ios_obj(struct ore_io_state *ios, unsigned index) | |||
62 | 62 | ||
63 | static struct osd_dev *_ios_od(struct ore_io_state *ios, unsigned index) | 63 | static struct osd_dev *_ios_od(struct ore_io_state *ios, unsigned index) |
64 | { | 64 | { |
65 | ORE_DBGMSG2("oc->first_dev=%d oc->numdevs=%d i=%d oc->ods=%p\n", | ||
66 | ios->oc->first_dev, ios->oc->numdevs, index, | ||
67 | ios->oc->ods); | ||
68 | |||
65 | return ore_comp_dev(ios->oc, index); | 69 | return ore_comp_dev(ios->oc, index); |
66 | } | 70 | } |
67 | 71 | ||
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 { | |||
49 | }; | 49 | }; |
50 | 50 | ||
51 | struct ore_components { | 51 | struct ore_components { |
52 | unsigned first_dev; /* First logical device no */ | ||
52 | unsigned numdevs; /* Num of devices in array */ | 53 | unsigned numdevs; /* Num of devices in array */ |
53 | /* If @single_comp == EC_SINGLE_COMP, @comps points to a single | 54 | /* If @single_comp == EC_SINGLE_COMP, @comps points to a single |
54 | * component. else there are @numdevs components | 55 | * component. else there are @numdevs components |
@@ -70,14 +71,14 @@ struct ore_components { | |||
70 | static inline struct osd_dev *ore_comp_dev( | 71 | static inline struct osd_dev *ore_comp_dev( |
71 | const struct ore_components *oc, unsigned i) | 72 | const struct ore_components *oc, unsigned i) |
72 | { | 73 | { |
73 | BUG_ON(oc->numdevs <= i); | 74 | BUG_ON((i < oc->first_dev) || (oc->first_dev + oc->numdevs <= i)); |
74 | return oc->ods[i]->od; | 75 | return oc->ods[i - oc->first_dev]->od; |
75 | } | 76 | } |
76 | 77 | ||
77 | static inline void ore_comp_set_dev( | 78 | static inline void ore_comp_set_dev( |
78 | struct ore_components *oc, unsigned i, struct osd_dev *od) | 79 | struct ore_components *oc, unsigned i, struct osd_dev *od) |
79 | { | 80 | { |
80 | oc->ods[i]->od = od; | 81 | oc->ods[i - oc->first_dev]->od = od; |
81 | } | 82 | } |
82 | 83 | ||
83 | struct ore_striping_info { | 84 | struct ore_striping_info { |