diff options
-rw-r--r-- | fs/exofs/exofs.h | 3 | ||||
-rw-r--r-- | fs/exofs/super.c | 57 | ||||
-rw-r--r-- | include/scsi/osd_ore.h | 2 |
3 files changed, 24 insertions, 38 deletions
diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h index c09d5a765efe..3b2e0478f363 100644 --- a/fs/exofs/exofs.h +++ b/fs/exofs/exofs.h | |||
@@ -66,9 +66,6 @@ struct exofs_sb_info { | |||
66 | u32 s_next_generation; /* next gen # to use */ | 66 | u32 s_next_generation; /* next gen # to use */ |
67 | atomic_t s_curr_pending; /* number of pending commands */ | 67 | atomic_t s_curr_pending; /* number of pending commands */ |
68 | 68 | ||
69 | struct pnfs_osd_data_map data_map; /* Default raid to use | ||
70 | * FIXME: Needed ? | ||
71 | */ | ||
72 | struct ore_layout layout; /* Default files layout */ | 69 | struct ore_layout layout; /* Default files layout */ |
73 | struct ore_comp one_comp; /* id & cred of partition id=0*/ | 70 | struct ore_comp one_comp; /* id & cred of partition id=0*/ |
74 | struct ore_components oc; /* comps for the partition */ | 71 | struct ore_components oc; /* comps for the partition */ |
diff --git a/fs/exofs/super.c b/fs/exofs/super.c index babb1958f6f0..90b4c526939f 100644 --- a/fs/exofs/super.c +++ b/fs/exofs/super.c | |||
@@ -481,64 +481,51 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs, | |||
481 | { | 481 | { |
482 | u64 stripe_length; | 482 | u64 stripe_length; |
483 | 483 | ||
484 | sbi->data_map.odm_num_comps = | 484 | sbi->layout.stripe_unit = |
485 | le32_to_cpu(dt->dt_data_map.cb_num_comps); | ||
486 | sbi->data_map.odm_stripe_unit = | ||
487 | le64_to_cpu(dt->dt_data_map.cb_stripe_unit); | 485 | le64_to_cpu(dt->dt_data_map.cb_stripe_unit); |
488 | sbi->data_map.odm_group_width = | 486 | sbi->layout.group_width = |
489 | le32_to_cpu(dt->dt_data_map.cb_group_width); | 487 | le32_to_cpu(dt->dt_data_map.cb_group_width); |
490 | sbi->data_map.odm_group_depth = | 488 | sbi->layout.group_depth = |
491 | le32_to_cpu(dt->dt_data_map.cb_group_depth); | 489 | le32_to_cpu(dt->dt_data_map.cb_group_depth); |
492 | sbi->data_map.odm_mirror_cnt = | 490 | sbi->layout.mirrors_p1 = |
493 | le32_to_cpu(dt->dt_data_map.cb_mirror_cnt); | 491 | le32_to_cpu(dt->dt_data_map.cb_mirror_cnt) + 1; |
494 | sbi->data_map.odm_raid_algorithm = | 492 | sbi->layout.raid_algorithm = |
495 | le32_to_cpu(dt->dt_data_map.cb_raid_algorithm); | 493 | le32_to_cpu(dt->dt_data_map.cb_raid_algorithm); |
496 | 494 | ||
497 | /* FIXME: Only raid0 for now. if not so, do not mount */ | 495 | /* FIXME: Only raid0 for now. if not so, do not mount */ |
498 | if (sbi->data_map.odm_num_comps != numdevs) { | 496 | if (sbi->layout.raid_algorithm != PNFS_OSD_RAID_0) { |
499 | EXOFS_ERR("odm_num_comps(%u) != numdevs(%u)\n", | ||
500 | sbi->data_map.odm_num_comps, numdevs); | ||
501 | return -EINVAL; | ||
502 | } | ||
503 | if (sbi->data_map.odm_raid_algorithm != PNFS_OSD_RAID_0) { | ||
504 | EXOFS_ERR("Only RAID_0 for now\n"); | 497 | EXOFS_ERR("Only RAID_0 for now\n"); |
505 | return -EINVAL; | 498 | return -EINVAL; |
506 | } | 499 | } |
507 | if (0 != (numdevs % (sbi->data_map.odm_mirror_cnt + 1))) { | 500 | if (numdevs < (sbi->layout.group_width * sbi->layout.mirrors_p1)) { |
508 | EXOFS_ERR("Data Map wrong, numdevs=%d mirrors=%d\n", | 501 | EXOFS_ERR("Data Map wrong, " |
509 | numdevs, sbi->data_map.odm_mirror_cnt); | 502 | "numdevs=%d < group_width=%d * mirrors=%d\n", |
503 | numdevs, sbi->layout.group_width, | ||
504 | sbi->layout.mirrors_p1); | ||
510 | return -EINVAL; | 505 | return -EINVAL; |
511 | } | 506 | } |
512 | 507 | ||
513 | if (0 != (sbi->data_map.odm_stripe_unit & ~PAGE_MASK)) { | 508 | if (0 != (sbi->layout.stripe_unit & ~PAGE_MASK)) { |
514 | EXOFS_ERR("Stripe Unit(0x%llx)" | 509 | EXOFS_ERR("Stripe Unit(0x%llx)" |
515 | " must be Multples of PAGE_SIZE(0x%lx)\n", | 510 | " must be Multples of PAGE_SIZE(0x%lx)\n", |
516 | _LLU(sbi->data_map.odm_stripe_unit), PAGE_SIZE); | 511 | _LLU(sbi->layout.stripe_unit), PAGE_SIZE); |
517 | return -EINVAL; | 512 | return -EINVAL; |
518 | } | 513 | } |
519 | 514 | ||
520 | sbi->layout.stripe_unit = sbi->data_map.odm_stripe_unit; | 515 | if (sbi->layout.group_width) { |
521 | sbi->layout.mirrors_p1 = sbi->data_map.odm_mirror_cnt + 1; | ||
522 | |||
523 | if (sbi->data_map.odm_group_width) { | ||
524 | sbi->layout.group_width = sbi->data_map.odm_group_width; | ||
525 | sbi->layout.group_depth = sbi->data_map.odm_group_depth; | ||
526 | if (!sbi->layout.group_depth) { | 516 | if (!sbi->layout.group_depth) { |
527 | EXOFS_ERR("group_depth == 0 && group_width != 0\n"); | 517 | EXOFS_ERR("group_depth == 0 && group_width != 0\n"); |
528 | return -EINVAL; | 518 | return -EINVAL; |
529 | } | 519 | } |
530 | sbi->layout.group_count = sbi->data_map.odm_num_comps / | 520 | sbi->layout.group_count = numdevs / sbi->layout.mirrors_p1 / |
531 | sbi->layout.mirrors_p1 / | 521 | sbi->layout.group_width; |
532 | sbi->data_map.odm_group_width; | ||
533 | } else { | 522 | } else { |
534 | if (sbi->data_map.odm_group_depth) { | 523 | if (sbi->layout.group_depth) { |
535 | printk(KERN_NOTICE "Warning: group_depth ignored " | 524 | printk(KERN_NOTICE "Warning: group_depth ignored " |
536 | "group_width == 0 && group_depth == %d\n", | 525 | "group_width == 0 && group_depth == %lld\n", |
537 | sbi->data_map.odm_group_depth); | 526 | _LLU(sbi->layout.group_depth)); |
538 | sbi->data_map.odm_group_depth = 0; | ||
539 | } | 527 | } |
540 | sbi->layout.group_width = sbi->data_map.odm_num_comps / | 528 | sbi->layout.group_width = numdevs / sbi->layout.mirrors_p1; |
541 | sbi->layout.mirrors_p1; | ||
542 | sbi->layout.group_depth = -1; | 529 | sbi->layout.group_depth = -1; |
543 | sbi->layout.group_count = 1; | 530 | sbi->layout.group_count = 1; |
544 | } | 531 | } |
@@ -558,7 +545,7 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs, | |||
558 | sbi->layout.group_width, | 545 | sbi->layout.group_width, |
559 | _LLU(sbi->layout.group_depth), | 546 | _LLU(sbi->layout.group_depth), |
560 | sbi->layout.mirrors_p1, | 547 | sbi->layout.mirrors_p1, |
561 | sbi->data_map.odm_raid_algorithm); | 548 | sbi->layout.raid_algorithm); |
562 | return 0; | 549 | return 0; |
563 | } | 550 | } |
564 | 551 | ||
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h index 954292a23767..f7fabb478877 100644 --- a/include/scsi/osd_ore.h +++ b/include/scsi/osd_ore.h | |||
@@ -34,6 +34,8 @@ struct ore_comp { | |||
34 | 34 | ||
35 | struct ore_layout { | 35 | struct ore_layout { |
36 | /* Our way of looking at the data_map */ | 36 | /* Our way of looking at the data_map */ |
37 | enum pnfs_osd_raid_algorithm4 | ||
38 | raid_algorithm; | ||
37 | unsigned stripe_unit; | 39 | unsigned stripe_unit; |
38 | unsigned mirrors_p1; | 40 | unsigned mirrors_p1; |
39 | 41 | ||