Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263171
b: refs/heads/master
c: 6719db6
h: refs/heads/master
i:
  263169: 49e7f8d
  263167: b80f9c7
v: v3
  • Loading branch information
Josef Bacik authored and Linus Torvalds committed Aug 21, 2011
1 parent 5c19b8b commit e4fc94c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: c063d8a60fc912ae198f054608ad461a69dc9a19
refs/heads/master: 6719db6a23d4b7f1e5052eedae394135e3aef9c1
12 changes: 7 additions & 5 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -6735,9 +6735,9 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices;
struct btrfs_device *device;
u64 min_free;
u64 dev_min = 1;
u64 dev_nr = 0;
int index;
int dev_nr = 0;
int dev_min = 1;
int full = 0;
int ret = 0;

Expand Down Expand Up @@ -6796,14 +6796,16 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
index = get_block_group_index(block_group);
if (index == 0) {
dev_min = 4;
min_free /= 2;
/* Divide by 2 */
min_free >>= 1;
} else if (index == 1) {
dev_min = 2;
} else if (index == 2) {
min_free *= 2;
/* Multiply by 2 */
min_free <<= 1;
} else if (index == 3) {
dev_min = fs_devices->rw_devices;
min_free /= dev_min;
do_div(min_free, dev_min);
}

mutex_lock(&root->fs_info->chunk_mutex);
Expand Down

0 comments on commit e4fc94c

Please sign in to comment.