summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-09-17 16:50:06 +0200
committerChris Mason <chris.mason@fusionio.com>2013-09-21 17:05:27 +0200
commitc4fbb4300abd6f662c7d5049d01f868af9874069 (patch)
treec0f6c6ccb6fa345681a453b0db9d4dc9719dad7a /fs/btrfs/ctree.h
parentRevert "Btrfs: rework the overcommit logic to be based on the total size" (diff)
downloadlinux-c4fbb4300abd6f662c7d5049d01f868af9874069.tar.xz
linux-c4fbb4300abd6f662c7d5049d01f868af9874069.zip
Btrfs: fix worst case calculator for space usage
Forever ago I made the worst case calculator say that we could potentially split into 3 blocks for every level on the way down, which isn't right. If we split we're only going to get two new blocks, the one we originally cow'ed and the new one we're going to split. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/ctree.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2491ba076b42..36490b92ee33 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3135,7 +3135,7 @@ static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_root *root,
unsigned num_items)
{
return (root->leafsize + root->nodesize * (BTRFS_MAX_LEVEL - 1)) *
- 3 * num_items;
+ 2 * num_items;
}
/*