From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 1/3] ext4: remove block bitmap initialization in ext4_new_inode()
Date: Fri, 13 Jan 2012 16:30:47 -0500 [thread overview]
Message-ID: <1326490249-1685-2-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1326490249-1685-1-git-send-email-tytso@mit.edu>
We don't need to initialize the block bitmap when we allocate a new
inode. This is old code from the very early days that is just
confusing things, and also has the problem of modifying the block
group descriptor without obeying the ext4_journal_get_write_access() /
ext4_handle_dirty_metadata() modification protocols.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/ext4/ialloc.c | 31 -------------------------------
1 files changed, 0 insertions(+), 31 deletions(-)
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 72fc989..a4ce10f 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -807,37 +807,6 @@ repeat_in_this_group:
goto out;
got:
- /* We may have to initialize the block bitmap if it isn't already */
- if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
- gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
- struct buffer_head *block_bitmap_bh;
-
- block_bitmap_bh = ext4_read_block_bitmap(sb, group);
- BUFFER_TRACE(block_bitmap_bh, "get block bitmap access");
- err = ext4_journal_get_write_access(handle, block_bitmap_bh);
- if (err) {
- brelse(block_bitmap_bh);
- goto fail;
- }
-
- BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap");
- err = ext4_handle_dirty_metadata(handle, NULL, block_bitmap_bh);
- brelse(block_bitmap_bh);
-
- /* recheck and clear flag under lock if we still need to */
- ext4_lock_group(sb, group);
- if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
- gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
- ext4_free_group_clusters_set(sb, gdp,
- ext4_free_clusters_after_init(sb, group, gdp));
- gdp->bg_checksum = ext4_group_desc_csum(sbi, group,
- gdp);
- }
- ext4_unlock_group(sb, group);
next prev parent reply other threads:[~2012-01-13 21:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-13 21:30 [PATCH 0/3] Clean up bitmap loading Theodore Ts'o
2012-01-13 21:30 ` Theodore Ts'o [this message]
2012-01-14 5:02 ` [PATCH 1/3] ext4: remove block bitmap initialization in ext4_new_inode() Andreas Dilger
2012-01-14 18:41 ` Amir Goldstein
2012-01-15 17:25 ` Andreas Dilger
2012-01-16 15:52 ` Ted Ts'o
2012-01-13 21:30 ` [PATCH 2/3] ext4: fold ext4_claim_inode into ext4_new_inode Theodore Ts'o
2012-01-13 21:30 ` [PATCH 3/3] ext4: fix race when setting bitmap_uptdate flag Theodore Ts'o
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=1326490249-1685-2-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--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).