Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322363
b: refs/heads/master
c: 6fc823b
h: refs/heads/master
i:
  322361: 0e2359e
  322359: a566128
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Aug 28, 2012
1 parent 0275aaf commit 3595d79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 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: 66657b318e0e443ada229fccd40c8be86cfebdbf
refs/heads/master: 6fc823b10f333313deb0b5d9069cbfd3a3f99f3a
15 changes: 7 additions & 8 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2975,17 +2975,16 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
}
spin_unlock(&block_group->lock);

num_pages = (int)div64_u64(block_group->key.offset, 1024 * 1024 * 1024);
/*
* Try to preallocate enough space based on how big the block group is.
* Keep in mind this has to include any pinned space which could end up
* taking up quite a bit since it's not folded into the other space
* cache.
*/
num_pages = (int)div64_u64(block_group->key.offset, 256 * 1024 * 1024);
if (!num_pages)
num_pages = 1;

/*
* Just to make absolutely sure we have enough space, we're going to
* preallocate 12 pages worth of space for each block group. In
* practice we ought to use at most 8, but we need extra space so we can
* add our header and have a terminator between the extents and the
* bitmaps.
*/
num_pages *= 16;
num_pages *= PAGE_CACHE_SIZE;

Expand Down

0 comments on commit 3595d79

Please sign in to comment.