diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2010-02-11 06:01:39 -0500 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2010-02-28 06:55:53 -0500 |
commit | 50a76fd3c352ed2740eba01512efcfceee0703be (patch) | |
tree | 425416e068648e225b41327a120d00bbddd16d0e /fs/exofs/super.c | |
parent | b367e78bd1c7af4c018ce98b1f6d3e001aba895a (diff) |
exofs: groups support
* _calc_stripe_info() changes to accommodate for grouping
calculations. Returns additional information
* old _prepare_pages() becomes _prepare_one_group()
which stores pages belonging to one device group.
* New _prepare_for_striping iterates on all groups calling
_prepare_one_group().
* Enable mounting of groups data_maps (group_width != 0)
[QUESTION]
what is faster A or B;
A. x += stride;
x = x % width + first_x;
B x += stride
if (x < last_x)
x = first_x;
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/super.c')
-rw-r--r-- | fs/exofs/super.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/fs/exofs/super.c b/fs/exofs/super.c index 8f4e4b37a578..6cf5e4e84d61 100644 --- a/fs/exofs/super.c +++ b/fs/exofs/super.c | |||
@@ -323,11 +323,7 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs, | |||
323 | sbi->data_map.odm_raid_algorithm = | 323 | sbi->data_map.odm_raid_algorithm = |
324 | le32_to_cpu(dt->dt_data_map.cb_raid_algorithm); | 324 | le32_to_cpu(dt->dt_data_map.cb_raid_algorithm); |
325 | 325 | ||
326 | /* FIXME: Only raid0 !group_width/depth for now. if not so, do not mount */ | 326 | /* FIXME: Only raid0 for now. if not so, do not mount */ |
327 | if (sbi->data_map.odm_group_width || sbi->data_map.odm_group_depth) { | ||
328 | EXOFS_ERR("Group width/depth not supported\n"); | ||
329 | return -EINVAL; | ||
330 | } | ||
331 | if (sbi->data_map.odm_num_comps != numdevs) { | 327 | if (sbi->data_map.odm_num_comps != numdevs) { |
332 | EXOFS_ERR("odm_num_comps(%u) != numdevs(%u)\n", | 328 | EXOFS_ERR("odm_num_comps(%u) != numdevs(%u)\n", |
333 | sbi->data_map.odm_num_comps, numdevs); | 329 | sbi->data_map.odm_num_comps, numdevs); |
@@ -343,14 +339,6 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs, | |||
343 | return -EINVAL; | 339 | return -EINVAL; |
344 | } | 340 | } |
345 | 341 | ||
346 | stripe_length = sbi->data_map.odm_stripe_unit * | ||
347 | (numdevs / (sbi->data_map.odm_mirror_cnt + 1)); | ||
348 | if (stripe_length >= (1ULL << 32)) { | ||
349 | EXOFS_ERR("Total Stripe length(0x%llx)" | ||
350 | " >= 32bit is not supported\n", _LLU(stripe_length)); | ||
351 | return -EINVAL; | ||
352 | } | ||
353 | |||
354 | if (0 != (sbi->data_map.odm_stripe_unit & ~PAGE_MASK)) { | 342 | if (0 != (sbi->data_map.odm_stripe_unit & ~PAGE_MASK)) { |
355 | EXOFS_ERR("Stripe Unit(0x%llx)" | 343 | EXOFS_ERR("Stripe Unit(0x%llx)" |
356 | " must be Multples of PAGE_SIZE(0x%lx)\n", | 344 | " must be Multples of PAGE_SIZE(0x%lx)\n", |
@@ -360,8 +348,36 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs, | |||
360 | 348 | ||
361 | sbi->layout.stripe_unit = sbi->data_map.odm_stripe_unit; | 349 | sbi->layout.stripe_unit = sbi->data_map.odm_stripe_unit; |
362 | sbi->layout.mirrors_p1 = sbi->data_map.odm_mirror_cnt + 1; | 350 | sbi->layout.mirrors_p1 = sbi->data_map.odm_mirror_cnt + 1; |
363 | sbi->layout.group_width = sbi->data_map.odm_num_comps / | 351 | |
352 | if (sbi->data_map.odm_group_width) { | ||
353 | sbi->layout.group_width = sbi->data_map.odm_group_width; | ||
354 | sbi->layout.group_depth = sbi->data_map.odm_group_depth; | ||
355 | if (!sbi->layout.group_depth) { | ||
356 | EXOFS_ERR("group_depth == 0 && group_width != 0\n"); | ||
357 | return -EINVAL; | ||
358 | } | ||
359 | sbi->layout.group_count = sbi->data_map.odm_num_comps / | ||
360 | sbi->layout.mirrors_p1 / | ||
361 | sbi->data_map.odm_group_width; | ||
362 | } else { | ||
363 | if (sbi->data_map.odm_group_depth) { | ||
364 | printk(KERN_NOTICE "Warning: group_depth ignored " | ||
365 | "group_width == 0 && group_depth == %d\n", | ||
366 | sbi->data_map.odm_group_depth); | ||
367 | sbi->data_map.odm_group_depth = 0; | ||
368 | } | ||
369 | sbi->layout.group_width = sbi->data_map.odm_num_comps / | ||
364 | sbi->layout.mirrors_p1; | 370 | sbi->layout.mirrors_p1; |
371 | sbi->layout.group_depth = -1; | ||
372 | sbi->layout.group_count = 1; | ||
373 | } | ||
374 | |||
375 | stripe_length = (u64)sbi->layout.group_width * sbi->layout.stripe_unit; | ||
376 | if (stripe_length >= (1ULL << 32)) { | ||
377 | EXOFS_ERR("Total Stripe length(0x%llx)" | ||
378 | " >= 32bit is not supported\n", _LLU(stripe_length)); | ||
379 | return -EINVAL; | ||
380 | } | ||
365 | 381 | ||
366 | return 0; | 382 | return 0; |
367 | } | 383 | } |
@@ -540,6 +556,8 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent) | |||
540 | sbi->layout.stripe_unit = PAGE_SIZE; | 556 | sbi->layout.stripe_unit = PAGE_SIZE; |
541 | sbi->layout.mirrors_p1 = 1; | 557 | sbi->layout.mirrors_p1 = 1; |
542 | sbi->layout.group_width = 1; | 558 | sbi->layout.group_width = 1; |
559 | sbi->layout.group_depth = -1; | ||
560 | sbi->layout.group_count = 1; | ||
543 | sbi->layout.s_ods[0] = od; | 561 | sbi->layout.s_ods[0] = od; |
544 | sbi->layout.s_numdevs = 1; | 562 | sbi->layout.s_numdevs = 1; |
545 | sbi->layout.s_pid = opts->pid; | 563 | sbi->layout.s_pid = opts->pid; |