Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128758
b: refs/heads/master
c: 2fff734
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent b2d1010 commit 0b1d857
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 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: a236aed14ccb0661611d4416f6b573d892bdc60a
refs/heads/master: 2fff734fafa742236aecbdcdc8b1ff4d221cbaca
17 changes: 7 additions & 10 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1509,17 +1509,17 @@ static int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw,
if (map->type & BTRFS_BLOCK_GROUP_RAID1) {
if (unplug_page || (rw & (1 << BIO_RW)))
num_stripes = map->num_stripes;
else if (mirror_num) {
else if (mirror_num)
stripe_index = mirror_num - 1;
} else {
u64 orig_stripe_nr = stripe_nr;
stripe_index = do_div(orig_stripe_nr, num_stripes);
}
else
stripe_index = current->pid % map->num_stripes;

} else if (map->type & BTRFS_BLOCK_GROUP_DUP) {
if (rw & (1 << BIO_RW))
num_stripes = map->num_stripes;
else if (mirror_num)
stripe_index = mirror_num - 1;

} else if (map->type & BTRFS_BLOCK_GROUP_RAID10) {
int factor = map->num_stripes / map->sub_stripes;

Expand All @@ -1530,11 +1530,8 @@ static int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw,
num_stripes = map->sub_stripes;
else if (mirror_num)
stripe_index += mirror_num - 1;
else {
u64 orig_stripe_nr = stripe_nr;
stripe_index += do_div(orig_stripe_nr,
map->sub_stripes);
}
else
stripe_index += current->pid % map->sub_stripes;
} else {
/*
* after this do_div call, stripe_nr is the number of stripes
Expand Down

0 comments on commit 0b1d857

Please sign in to comment.