Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128408
b: refs/heads/master
c: 85e55b1
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason authored and David Woodhouse committed Jun 19, 2007
1 parent b43c9d1 commit ca8f099
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 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: 63c992fd0b733989d43e9762f48e300d61b5287e
refs/heads/master: 85e55b13e4e318672f669747e5e010d1b707b198
14 changes: 12 additions & 2 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct
BUG_ON(ret);
}
extent_root->fs_info->extent_tree_insert_nr = 0;
extent_root->fs_info->extent_tree_prealloc_nr = 0;
return 0;
}

Expand Down Expand Up @@ -951,6 +950,18 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
num_blocks = 1;
total_needed = (min(level + 1, BTRFS_MAX_LEVEL) + 2) * 3;
}
if (fill_prealloc) {
u64 first;
int nr = info->extent_tree_prealloc_nr;
first = info->extent_tree_prealloc[nr - 1];
if (info->extent_tree_prealloc_nr >= total_needed &&
first >= search_start) {
ins->objectid = info->extent_tree_prealloc[0];
ins->offset = 1;
return 0;
}
info->extent_tree_prealloc_nr = 0;
}
if (search_end == (u64)-1)
search_end = btrfs_super_total_blocks(info->disk_super);
if (hint_block) {
Expand Down Expand Up @@ -1107,7 +1118,6 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
if (ins->objectid + num_blocks > first &&
ins->objectid <= info->extent_tree_prealloc[0]) {
search_start = info->extent_tree_prealloc[0] + 1;
WARN_ON(!full_scan);
goto new_group;
}
}
Expand Down

0 comments on commit ca8f099

Please sign in to comment.