aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 20:33:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 20:33:20 -0500
commit0aefda3e8188ad71168bd32152d41b3d72f04087 (patch)
treeb0f57efd9dd5d7993ea9b3ff45842f5f1bd6d06c /fs/btrfs/inode.c
parent2ef392042debb86003e3e1d756960a2e53930b60 (diff)
parentde3cb945db4d8eb3b046dc7a5ea89a893372750c (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs fixes from Chris Mason: "These are scattered fixes and one performance improvement. The biggest functional change is in how we throttle metadata changes. The new code bumps our average file creation rate up by ~13% in fs_mark, and lowers CPU usage. Stefan bisected out a regression in our allocation code that made balance loop on extents larger than 256MB." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: Btrfs: improve the delayed inode throttling Btrfs: fix a mismerge in btrfs_balance() Btrfs: enforce min_bytes parameter during extent allocation Btrfs: allow running defrag in parallel to administrative tasks Btrfs: avoid deadlock on transaction waiting list Btrfs: do not BUG_ON on aborted situation Btrfs: do not BUG_ON in prepare_to_reloc Btrfs: free all recorded tree blocks on error Btrfs: build up error handling for merge_reloc_roots Btrfs: check for NULL pointer in updating reloc roots Btrfs: fix unclosed transaction handler when the async transaction commitment fails Btrfs: fix wrong handle at error path of create_snapshot() when the commit fails Btrfs: use set_nlink if our i_nlink is 0
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c226daefd65d..d1470adca8f8 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8502,6 +8502,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
8502 struct btrfs_key ins; 8502 struct btrfs_key ins;
8503 u64 cur_offset = start; 8503 u64 cur_offset = start;
8504 u64 i_size; 8504 u64 i_size;
8505 u64 cur_bytes;
8505 int ret = 0; 8506 int ret = 0;
8506 bool own_trans = true; 8507 bool own_trans = true;
8507 8508
@@ -8516,8 +8517,9 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
8516 } 8517 }
8517 } 8518 }
8518 8519
8519 ret = btrfs_reserve_extent(trans, root, 8520 cur_bytes = min(num_bytes, 256ULL * 1024 * 1024);
8520 min(num_bytes, 256ULL * 1024 * 1024), 8521 cur_bytes = max(cur_bytes, min_size);
8522 ret = btrfs_reserve_extent(trans, root, cur_bytes,
8521 min_size, 0, *alloc_hint, &ins, 1); 8523 min_size, 0, *alloc_hint, &ins, 1);
8522 if (ret) { 8524 if (ret) {
8523 if (own_trans) 8525 if (own_trans)