Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274671
b: refs/heads/master
c: 60d2adb
h: refs/heads/master
i:
  274669: d00e078
  274667: 5e1f003
  274663: 655664f
  274655: 596ed21
v: v3
  • Loading branch information
Miao Xie authored and David Sterba committed Oct 20, 2011
1 parent d829b89 commit d57bc77
Show file tree
Hide file tree
Showing 2 changed files with 8 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: cfbffc39ac89dbd5197cbeec2599a1128eb928f8
refs/heads/master: 60d2adbb1e7fee1cb4bc67f70bd0bd8ace7b6c3c
7 changes: 7 additions & 0 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4954,6 +4954,7 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
bool failed_cluster_refill = false;
bool failed_alloc = false;
bool use_cluster = true;
bool have_caching_bg = false;
u64 ideal_cache_percent = 0;
u64 ideal_cache_offset = 0;

Expand Down Expand Up @@ -5036,6 +5037,7 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
}
}
search:
have_caching_bg = false;
down_read(&space_info->groups_sem);
list_for_each_entry(block_group, &space_info->block_groups[index],
list) {
Expand Down Expand Up @@ -5244,6 +5246,8 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
failed_alloc = true;
goto have_block_group;
} else if (!offset) {
if (!cached)
have_caching_bg = true;
goto loop;
}
checks:
Expand Down Expand Up @@ -5294,6 +5298,9 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
}
up_read(&space_info->groups_sem);

if (!ins->objectid && loop >= LOOP_CACHING_WAIT && have_caching_bg)
goto search;

if (!ins->objectid && ++index < BTRFS_NR_RAID_TYPES)
goto search;

Expand Down

0 comments on commit d57bc77

Please sign in to comment.