summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJohann Lombardi <johann.lombardi@bull.net>2006-12-06 20:40:46 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:46 -0800
commitfeb189274638ea357750a9e809f5a6e2223a082e (patch)
treeff783ee2a84cf6dd0319533515a8cfa2d21ec9a1 /fs
parent97d2a80584b30b5cd32da411deca1986ef61877a (diff)
[PATCH] ext4: fix credit calculation in ext4_ext_calc_credits_for_insert
Fix a nit in ext4_ext_calc_credits_for_insert(). Besides, credits for the new root are already added in the index split accounting. Signed-off-by: Johann Lombardi <johann.lombardi@bull.net> Signed-off-by: Alex Tomas <alex@clusterfs.com> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/extents.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 1442ccbaea79..994a6e450e06 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1531,16 +1531,17 @@ int inline ext4_ext_calc_credits_for_insert(struct inode *inode,
/*
* tree can be full, so it would need to grow in depth:
- * allocation + old root + new root
+ * we need one credit to modify old root, credits for
+ * new root will be added in split accounting
*/
- needed += 2 + 1 + 1;
+ needed += 1;
/*
* Index split can happen, we would need:
* allocate intermediate indexes (bitmap + group)
* + change two blocks at each level, but root (already included)
*/
- needed = (depth * 2) + (depth * 2);
+ needed += (depth * 2) + (depth * 2);
/* any allocation modifies superblock */
needed += 1;