From: Johann Lombardi <johann.lombardi@bull.net>
To: linux-ext4@vger.kernel.org
Cc: akpm@osdl.org
Subject: [PATCH] ext4: fix credit calculation in ext4_ext_calc_credits_for_insert
Date: Mon, 4 Dec 2006 18:21:42 +0100 [thread overview]
Message-ID: <20061204172142.GD7492@lombardij> (raw)
Hello,
The patch below fixes a nit in ext4_ext_calc_credits_for_insert().
Besides, credits for the new root are already added in the index split
accounting.
Johann
Signed-off-by: Johann Lombardi <johann.lombardi@bull.net>
Signed-off-by: Alex Tomas <alex@clusterfs.com>
---
Index: linux-2.6.19/fs/ext4/extents.c
===================================================================
--- linux-2.6.19.orig/fs/ext4/extents.c 2006-12-04 16:59:41.760257656 +0100
+++ linux-2.6.19/fs/ext4/extents.c 2006-12-04 17:04:35.566592304 +0100
@@ -1534,16 +1534,17 @@ int inline ext4_ext_calc_credits_for_ins
/*
* 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;
reply other threads:[~2006-12-04 17:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061204172142.GD7492@lombardij \
--to=johann.lombardi@bull.net \
--cc=akpm@osdl.org \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).