aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-09-28 05:04:23 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-10-14 12:54:41 -0400
commit3bd9856857339d7ee8c4ad50030583f1b9415c39 (patch)
treefa5d950b9beffa2a10bc698d452ae50b8e195d5e /include/scsi
parentbbf9a31bba8c985780fe94da059cc5813a7920f5 (diff)
ore: Support for partial component table
Users like the objlayout-driver would like to only pass a partial device table that covers the IO in question. For example exofs divides the file into raid-group-sized chunks and only serves group_width number of devices at a time. The partiality is communicated by setting ore_componets->first_dev and the array covers all logical devices from oc->first_dev upto (oc->first_dev + oc->numdevs) The ore_comp_dev() API receives a logical device index and returns the actual present device in the table. An out-of-range dev_index will BUG. Logical device index is the theoretical device index as if all the devices of a file are present. .i.e: total_devs = group_width * mirror_p1 * group_count 0 <= dev_index < total_devs Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
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 {
49}; 49};
50 50
51struct ore_components { 51struct 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 {
70static inline struct osd_dev *ore_comp_dev( 71static 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
77static inline void ore_comp_set_dev( 78static 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
83struct ore_striping_info { 84struct ore_striping_info {