aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-08-10 17:17:28 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-10-03 11:07:51 -0400
commiteb507bc18969f63b8968034144fd69706c492516 (patch)
tree6f5606ce9af0636316683a03ed4f993afa10ed2d
parent8d2d83a8352b0f9c1da82c36f741722f2960feea (diff)
ore: Make ore_striping_info and ore_calc_stripe_info public
The struct ore_striping_info will be used later in other structures. And ore_calc_stripe_info as well. Rename them make struct ore_striping_info public. ore_calc_stripe_info is still static, will be made public on first use. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
-rw-r--r--fs/exofs/ore.c24
-rw-r--r--include/scsi/osd_ore.h8
2 files changed, 16 insertions, 16 deletions
diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c
index 870f85a232d1..c2b0033a724b 100644
--- a/fs/exofs/ore.c
+++ b/fs/exofs/ore.c
@@ -287,16 +287,8 @@ EXPORT_SYMBOL(ore_check_io);
287 * 287 *
288 * O = L % stripe_unit + N * stripe_unit + M * group_depth * stripe_unit 288 * O = L % stripe_unit + N * stripe_unit + M * group_depth * stripe_unit
289 */ 289 */
290struct _striping_info { 290static void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset,
291 u64 obj_offset; 291 struct ore_striping_info *si)
292 u64 group_length;
293 u64 M; /* for truncate */
294 unsigned dev;
295 unsigned unit_off;
296};
297
298static void _calc_stripe_info(struct ore_layout *layout, u64 file_offset,
299 struct _striping_info *si)
300{ 292{
301 u32 stripe_unit = layout->stripe_unit; 293 u32 stripe_unit = layout->stripe_unit;
302 u32 group_width = layout->group_width; 294 u32 group_width = layout->group_width;
@@ -375,7 +367,7 @@ static int _add_stripe_unit(struct ore_io_state *ios, unsigned *cur_pg,
375} 367}
376 368
377static int _prepare_one_group(struct ore_io_state *ios, u64 length, 369static int _prepare_one_group(struct ore_io_state *ios, u64 length,
378 struct _striping_info *si) 370 struct ore_striping_info *si)
379{ 371{
380 unsigned stripe_unit = ios->layout->stripe_unit; 372 unsigned stripe_unit = ios->layout->stripe_unit;
381 unsigned mirrors_p1 = ios->layout->mirrors_p1; 373 unsigned mirrors_p1 = ios->layout->mirrors_p1;
@@ -434,14 +426,14 @@ static int _prepare_for_striping(struct ore_io_state *ios)
434{ 426{
435 u64 length = ios->length; 427 u64 length = ios->length;
436 u64 offset = ios->offset; 428 u64 offset = ios->offset;
437 struct _striping_info si; 429 struct ore_striping_info si;
438 int ret = 0; 430 int ret = 0;
439 431
440 if (!ios->pages) { 432 if (!ios->pages) {
441 if (ios->kern_buff) { 433 if (ios->kern_buff) {
442 struct ore_per_dev_state *per_dev = &ios->per_dev[0]; 434 struct ore_per_dev_state *per_dev = &ios->per_dev[0];
443 435
444 _calc_stripe_info(ios->layout, ios->offset, &si); 436 ore_calc_stripe_info(ios->layout, ios->offset, &si);
445 per_dev->offset = si.obj_offset; 437 per_dev->offset = si.obj_offset;
446 per_dev->dev = si.dev; 438 per_dev->dev = si.dev;
447 439
@@ -455,7 +447,7 @@ static int _prepare_for_striping(struct ore_io_state *ios)
455 } 447 }
456 448
457 while (length) { 449 while (length) {
458 _calc_stripe_info(ios->layout, offset, &si); 450 ore_calc_stripe_info(ios->layout, offset, &si);
459 451
460 if (length < si.group_length) 452 if (length < si.group_length)
461 si.group_length = length; 453 si.group_length = length;
@@ -744,7 +736,7 @@ static int _truncate_mirrors(struct ore_io_state *ios, unsigned cur_comp,
744} 736}
745 737
746struct _trunc_info { 738struct _trunc_info {
747 struct _striping_info si; 739 struct ore_striping_info si;
748 u64 prev_group_obj_off; 740 u64 prev_group_obj_off;
749 u64 next_group_obj_off; 741 u64 next_group_obj_off;
750 742
@@ -758,7 +750,7 @@ static void _calc_trunk_info(struct ore_layout *layout, u64 file_offset,
758{ 750{
759 unsigned stripe_unit = layout->stripe_unit; 751 unsigned stripe_unit = layout->stripe_unit;
760 752
761 _calc_stripe_info(layout, file_offset, &ti->si); 753 ore_calc_stripe_info(layout, file_offset, &ti->si);
762 754
763 ti->prev_group_obj_off = ti->si.M * stripe_unit; 755 ti->prev_group_obj_off = ti->si.M * stripe_unit;
764 ti->next_group_obj_off = ti->si.M ? (ti->si.M - 1) * stripe_unit : 0; 756 ti->next_group_obj_off = ti->si.M ? (ti->si.M - 1) * stripe_unit : 0;
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
index f7fabb478877..e4d550faa7c9 100644
--- a/include/scsi/osd_ore.h
+++ b/include/scsi/osd_ore.h
@@ -56,6 +56,14 @@ struct ore_components {
56 struct osd_dev **ods; /* osd_dev array */ 56 struct osd_dev **ods; /* osd_dev array */
57}; 57};
58 58
59struct ore_striping_info {
60 u64 obj_offset;
61 u64 group_length;
62 u64 M; /* for truncate */
63 unsigned dev;
64 unsigned unit_off;
65};
66
59struct ore_io_state; 67struct ore_io_state;
60typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private); 68typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private);
61 69