Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299799
b: refs/heads/master
c: 207a232
h: refs/heads/master
i:
  299797: fa50cf3
  299795: 7ae443e
  299791: 19c245d
v: v3
  • Loading branch information
Arne Jansen authored and David Sterba committed Apr 18, 2012
1 parent 9ac0938 commit fb9388b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c9c2bf7a3c4f7e9d158c0be9c49f372fb943ad2
refs/heads/master: 207a232ccac0a8cb79d304bd17298dbc96e2e082
13 changes: 13 additions & 0 deletions trunk/fs/btrfs/reada.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
struct btrfs_bio *bbio = NULL;
struct btrfs_device *dev;
struct btrfs_device *prev_dev;
u32 blocksize;
u64 length;
int nzones = 0;
Expand Down Expand Up @@ -405,8 +406,20 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
spin_unlock(&fs_info->reada_lock);
goto error;
}
prev_dev = NULL;
for (i = 0; i < nzones; ++i) {
dev = bbio->stripes[i].dev;
if (dev == prev_dev) {
/*
* in case of DUP, just add the first zone. As both
* are on the same device, there's nothing to gain
* from adding both.
* Also, it wouldn't work, as the tree is per device
* and adding would fail with EEXIST
*/
continue;
}
prev_dev = dev;
ret = radix_tree_insert(&dev->reada_extents, index, re);
if (ret) {
while (--i >= 0) {
Expand Down

0 comments on commit fb9388b

Please sign in to comment.