Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360477
b: refs/heads/master
c: 24542bf
h: refs/heads/master
i:
  360475: 1129577
v: v3
  • Loading branch information
Zach Brown authored and Chris Mason committed Feb 20, 2013
1 parent cb12553 commit 53d1f5f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 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: 1cba0cdf5e4dbcd9e5fa5b54d7a028e55e2ca057
refs/heads/master: 24542bf7ea5e4fdfdb5157ff544c093fa4dcb536
2 changes: 1 addition & 1 deletion trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -6143,7 +6143,7 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
if (ret == -ENOSPC) {
if (!final_tried) {
num_bytes = num_bytes >> 1;
num_bytes = num_bytes & ~(root->sectorsize - 1);
num_bytes = round_down(num_bytes, root->sectorsize);
num_bytes = max(num_bytes, min_alloc_size);
if (num_bytes == min_alloc_size)
final_tried = true;
Expand Down
5 changes: 3 additions & 2 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -7894,8 +7894,9 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
}
}

ret = btrfs_reserve_extent(trans, root, num_bytes, min_size,
0, *alloc_hint, &ins, 1);
ret = btrfs_reserve_extent(trans, root,
min(num_bytes, 256ULL * 1024 * 1024),
min_size, 0, *alloc_hint, &ins, 1);
if (ret) {
if (own_trans)
btrfs_end_transaction(trans, root);
Expand Down

0 comments on commit 53d1f5f

Please sign in to comment.