Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269225
b: refs/heads/master
c: 8d2d83a
h: refs/heads/master
i:
  269223: 9cb3edc
v: v3
  • Loading branch information
Boaz Harrosh committed Oct 3, 2011
1 parent ec0c8df commit 180d0ef
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5bf696dad4beecb6174e701c97e1f2574e6a2c96
refs/heads/master: 8d2d83a8352b0f9c1da82c36f741722f2960feea
3 changes: 0 additions & 3 deletions trunk/fs/exofs/exofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ struct exofs_sb_info {
u32 s_next_generation; /* next gen # to use */
atomic_t s_curr_pending; /* number of pending commands */

struct pnfs_osd_data_map data_map; /* Default raid to use
* FIXME: Needed ?
*/
struct ore_layout layout; /* Default files layout */
struct ore_comp one_comp; /* id & cred of partition id=0*/
struct ore_components oc; /* comps for the partition */
Expand Down
57 changes: 22 additions & 35 deletions trunk/fs/exofs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,64 +481,51 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs,
{
u64 stripe_length;

sbi->data_map.odm_num_comps =
le32_to_cpu(dt->dt_data_map.cb_num_comps);
sbi->data_map.odm_stripe_unit =
sbi->layout.stripe_unit =
le64_to_cpu(dt->dt_data_map.cb_stripe_unit);
sbi->data_map.odm_group_width =
sbi->layout.group_width =
le32_to_cpu(dt->dt_data_map.cb_group_width);
sbi->data_map.odm_group_depth =
sbi->layout.group_depth =
le32_to_cpu(dt->dt_data_map.cb_group_depth);
sbi->data_map.odm_mirror_cnt =
le32_to_cpu(dt->dt_data_map.cb_mirror_cnt);
sbi->data_map.odm_raid_algorithm =
sbi->layout.mirrors_p1 =
le32_to_cpu(dt->dt_data_map.cb_mirror_cnt) + 1;
sbi->layout.raid_algorithm =
le32_to_cpu(dt->dt_data_map.cb_raid_algorithm);

/* FIXME: Only raid0 for now. if not so, do not mount */
if (sbi->data_map.odm_num_comps != numdevs) {
EXOFS_ERR("odm_num_comps(%u) != numdevs(%u)\n",
sbi->data_map.odm_num_comps, numdevs);
return -EINVAL;
}
if (sbi->data_map.odm_raid_algorithm != PNFS_OSD_RAID_0) {
if (sbi->layout.raid_algorithm != PNFS_OSD_RAID_0) {
EXOFS_ERR("Only RAID_0 for now\n");
return -EINVAL;
}
if (0 != (numdevs % (sbi->data_map.odm_mirror_cnt + 1))) {
EXOFS_ERR("Data Map wrong, numdevs=%d mirrors=%d\n",
numdevs, sbi->data_map.odm_mirror_cnt);
if (numdevs < (sbi->layout.group_width * sbi->layout.mirrors_p1)) {
EXOFS_ERR("Data Map wrong, "
"numdevs=%d < group_width=%d * mirrors=%d\n",
numdevs, sbi->layout.group_width,
sbi->layout.mirrors_p1);
return -EINVAL;
}

if (0 != (sbi->data_map.odm_stripe_unit & ~PAGE_MASK)) {
if (0 != (sbi->layout.stripe_unit & ~PAGE_MASK)) {
EXOFS_ERR("Stripe Unit(0x%llx)"
" must be Multples of PAGE_SIZE(0x%lx)\n",
_LLU(sbi->data_map.odm_stripe_unit), PAGE_SIZE);
_LLU(sbi->layout.stripe_unit), PAGE_SIZE);
return -EINVAL;
}

sbi->layout.stripe_unit = sbi->data_map.odm_stripe_unit;
sbi->layout.mirrors_p1 = sbi->data_map.odm_mirror_cnt + 1;

if (sbi->data_map.odm_group_width) {
sbi->layout.group_width = sbi->data_map.odm_group_width;
sbi->layout.group_depth = sbi->data_map.odm_group_depth;
if (sbi->layout.group_width) {
if (!sbi->layout.group_depth) {
EXOFS_ERR("group_depth == 0 && group_width != 0\n");
return -EINVAL;
}
sbi->layout.group_count = sbi->data_map.odm_num_comps /
sbi->layout.mirrors_p1 /
sbi->data_map.odm_group_width;
sbi->layout.group_count = numdevs / sbi->layout.mirrors_p1 /
sbi->layout.group_width;
} else {
if (sbi->data_map.odm_group_depth) {
if (sbi->layout.group_depth) {
printk(KERN_NOTICE "Warning: group_depth ignored "
"group_width == 0 && group_depth == %d\n",
sbi->data_map.odm_group_depth);
sbi->data_map.odm_group_depth = 0;
"group_width == 0 && group_depth == %lld\n",
_LLU(sbi->layout.group_depth));
}
sbi->layout.group_width = sbi->data_map.odm_num_comps /
sbi->layout.mirrors_p1;
sbi->layout.group_width = numdevs / sbi->layout.mirrors_p1;
sbi->layout.group_depth = -1;
sbi->layout.group_count = 1;
}
Expand All @@ -558,7 +545,7 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs,
sbi->layout.group_width,
_LLU(sbi->layout.group_depth),
sbi->layout.mirrors_p1,
sbi->data_map.odm_raid_algorithm);
sbi->layout.raid_algorithm);
return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/scsi/osd_ore.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ struct ore_comp {

struct ore_layout {
/* Our way of looking at the data_map */
enum pnfs_osd_raid_algorithm4
raid_algorithm;
unsigned stripe_unit;
unsigned mirrors_p1;

Expand Down

0 comments on commit 180d0ef

Please sign in to comment.