diff options
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/osd_ore.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h index e4d550faa7c9..8fefdfbb1ced 100644 --- a/include/scsi/osd_ore.h +++ b/include/scsi/osd_ore.h | |||
@@ -44,6 +44,10 @@ struct ore_layout { | |||
44 | unsigned group_count; | 44 | unsigned group_count; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | struct ore_dev { | ||
48 | struct osd_dev *od; | ||
49 | }; | ||
50 | |||
47 | struct ore_components { | 51 | struct ore_components { |
48 | unsigned numdevs; /* Num of devices in array */ | 52 | unsigned numdevs; /* Num of devices in array */ |
49 | /* If @single_comp == EC_SINGLE_COMP, @comps points to a single | 53 | /* If @single_comp == EC_SINGLE_COMP, @comps points to a single |
@@ -53,9 +57,29 @@ struct ore_components { | |||
53 | EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff | 57 | EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff |
54 | } single_comp; | 58 | } single_comp; |
55 | struct ore_comp *comps; | 59 | struct ore_comp *comps; |
56 | struct osd_dev **ods; /* osd_dev array */ | 60 | |
61 | /* Array of pointers to ore_dev-* . User will usually have these pointed | ||
62 | * too a bigger struct which contain an "ore_dev ored" member and use | ||
63 | * container_of(oc->ods[i], struct foo_dev, ored) to access the bigger | ||
64 | * structure. | ||
65 | */ | ||
66 | struct ore_dev **ods; | ||
57 | }; | 67 | }; |
58 | 68 | ||
69 | /* ore_comp_dev Recievies a logical device index */ | ||
70 | static inline struct osd_dev *ore_comp_dev( | ||
71 | const struct ore_components *oc, unsigned i) | ||
72 | { | ||
73 | BUG_ON(oc->numdevs <= i); | ||
74 | return oc->ods[i]->od; | ||
75 | } | ||
76 | |||
77 | static inline void ore_comp_set_dev( | ||
78 | struct ore_components *oc, unsigned i, struct osd_dev *od) | ||
79 | { | ||
80 | oc->ods[i]->od = od; | ||
81 | } | ||
82 | |||
59 | struct ore_striping_info { | 83 | struct ore_striping_info { |
60 | u64 obj_offset; | 84 | u64 obj_offset; |
61 | u64 group_length; | 85 | u64 group_length; |