aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-10-12 12:42:22 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-10-24 19:55:36 -0400
commita1fec1dbbc8db974d2582e4040590cebe72171e4 (patch)
tree9dcbe1933b7f40256f40393f3c86dbb16e8fb953 /include/scsi
parent3e335672e018c06e007f85a5d54afd721fb3d6d5 (diff)
ore: RAID5 read
This patch introduces the first stage of RAID5 support mainly the skip-over-raid-units when reading. For writes it inserts BLANK units, into where XOR blocks should be calculated and written to. It introduces the new "general raid maths", and the main additional parameters and components needed for raid5. Since at this stage it could corrupt future version that actually do support raid5. The enablement of raid5 mounting and setting of parity-count > 0 is disabled. So the raid5 code will never be used. Mounting of raid5 is only enabled later once the basic XOR write is also in. But if the patch "enable RAID5" is applied this code has been tested to be able to properly read raid5 volumes and is according to standard. Also it has been tested that the new maths still properly supports RAID0 and grouping code just as before. (BTW: I have found more bugs in the pnfs-obj RAID math fixed here) The ore.c file is getting too big, so new ore_raid.[hc] files are added that will include the special raid stuff that are not used in striping and mirrors. In future write support these will get bigger. When adding the ore_raid.c to Kbuild file I was forced to rename ore.ko to libore.ko. Is it possible to keep source file, say ore.c and module file ore.ko the same even if there are multiple files inside ore.ko? Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/osd_ore.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
index a8e39d14f82..43821c18cd3 100644
--- a/include/scsi/osd_ore.h
+++ b/include/scsi/osd_ore.h
@@ -40,6 +40,7 @@ struct ore_layout {
40 unsigned mirrors_p1; 40 unsigned mirrors_p1;
41 41
42 unsigned group_width; 42 unsigned group_width;
43 unsigned parity;
43 u64 group_depth; 44 u64 group_depth;
44 unsigned group_count; 45 unsigned group_count;
45 46
@@ -89,11 +90,16 @@ static inline void ore_comp_set_dev(
89} 90}
90 91
91struct ore_striping_info { 92struct ore_striping_info {
93 u64 offset;
92 u64 obj_offset; 94 u64 obj_offset;
93 u64 group_length; 95 u64 length;
96 u64 first_stripe_start; /* only used in raid writes */
94 u64 M; /* for truncate */ 97 u64 M; /* for truncate */
98 unsigned bytes_in_stripe;
95 unsigned dev; 99 unsigned dev;
100 unsigned par_dev;
96 unsigned unit_off; 101 unsigned unit_off;
102 unsigned cur_comp;
97}; 103};
98 104
99struct ore_io_state; 105struct ore_io_state;
@@ -127,6 +133,13 @@ struct ore_io_state {
127 133
128 bool reading; 134 bool reading;
129 135
136 /* House keeping of Parity pages */
137 bool extra_part_alloc;
138 struct page **parity_pages;
139 unsigned max_par_pages;
140 unsigned cur_par_page;
141 unsigned sgs_per_dev;
142
130 /* Variable array of size numdevs */ 143 /* Variable array of size numdevs */
131 unsigned numdevs; 144 unsigned numdevs;
132 struct ore_per_dev_state { 145 struct ore_per_dev_state {
@@ -134,7 +147,10 @@ struct ore_io_state {
134 struct bio *bio; 147 struct bio *bio;
135 loff_t offset; 148 loff_t offset;
136 unsigned length; 149 unsigned length;
150 unsigned last_sgs_total;
137 unsigned dev; 151 unsigned dev;
152 struct osd_sg_entry *sglist;
153 unsigned cur_sg;
138 } per_dev[]; 154 } per_dev[];
139}; 155};
140 156
@@ -147,8 +163,7 @@ static inline unsigned ore_io_state_size(unsigned numdevs)
147/* ore.c */ 163/* ore.c */
148int ore_verify_layout(unsigned total_comps, struct ore_layout *layout); 164int ore_verify_layout(unsigned total_comps, struct ore_layout *layout);
149void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset, 165void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset,
150 struct ore_striping_info *si); 166 u64 length, struct ore_striping_info *si);
151
152int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps, 167int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
153 bool is_reading, u64 offset, u64 length, 168 bool is_reading, u64 offset, u64 length,
154 struct ore_io_state **ios); 169 struct ore_io_state **ios);