linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: linux-ext4@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH, RFC 04/12] ext4: Remove block bitmap initialization in ext4_new_inode()
Date: Sat, 19 Mar 2011 17:28:29 -0400	[thread overview]
Message-ID: <1300570117-24048-5-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1300570117-24048-1-git-send-email-tytso@mit.edu>

We are initializing the block bitmap in ext4_new_inode(), and as far
as I can tell, there's no reason to do it.  So remove it to simplify
things.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 fs/ext4/ialloc.c |   37 -------------------------------------
 1 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index a679a48..88ad0e3 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -815,7 +815,6 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
 	int ret2, err = 0;
 	struct inode *ret;
 	ext4_group_t i;
-	int free = 0;
 	static int once = 1;
 	ext4_group_t flex_group;
 
@@ -936,42 +935,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;
-		}
-
-		free = 0;
-		ext4_lock_group(sb, group);
-		/* recheck and clear flag under lock if we still need to */
-		if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
-			free = ext4_free_blocks_after_init(sb, group, gdp);
-			gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
-			ext4_free_blks_set(sb, gdp, free);
-			gdp->bg_checksum = ext4_group_desc_csum(sbi, group,
-								gdp);
-		}
-		ext4_unlock_group(sb, group);
-
-		/* Don't need to dirty bitmap block if we didn't change it */
-		if (free) {
-			BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap");
-			err = ext4_handle_dirty_metadata(handle,
-							NULL, block_bitmap_bh);
-		}

  parent reply	other threads:[~2011-03-19 21:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-19 21:28 [PATCH, RFC 00/12] bigalloc patchset Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 01/12] ext4: read-only support for bigalloc file systems Theodore Ts'o
2011-03-21 19:35   ` Lukas Czerner
2011-03-22 17:02     ` Ted Ts'o
2011-03-23 10:28       ` Lukas Czerner
2011-03-19 21:28 ` [PATCH, RFC 02/12] ext4: enforce bigalloc restrictions (e.g., no online resizing, etc.) Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 03/12] ext4: Convert instances of EXT4_BLOCKS_PER_GROUP to EXT4_CLUSTERS_PER_GROUP Theodore Ts'o
2011-03-20 10:26   ` Amir Goldstein
2011-03-21 13:12     ` Ted Ts'o
2011-03-19 21:28 ` Theodore Ts'o [this message]
2011-03-19 21:28 ` [PATCH, RFC 05/12] ext4: factor out block group accounting into functions Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 06/12] ext4: split out ext4_free_blocks_after_init() Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 07/12] ext4: bigalloc changes to block bitmap initialization functions Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 08/12] ext4: Convert block group-relative offsets to use clusters Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 09/12] ext4: teach ext4_ext_map_blocks() about the bigalloc feature Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 10/12] ext4: teach ext4_statfs() to deal with clusters if bigalloc is enabled Theodore Ts'o
2011-03-21 20:17   ` Lukas Czerner
2011-03-22 22:09     ` Ted Ts'o
2011-03-19 21:28 ` [PATCH, RFC 11/12] ext4: tune mballoc's default group prealloc size for bigalloc file systems Theodore Ts'o
2011-03-19 21:28 ` [PATCH, RFC 12/12] ext4: enable mounting bigalloc as read/write Theodore Ts'o
2011-03-20 10:33 ` [PATCH, RFC 00/12] bigalloc patchset Amir Goldstein
2011-03-21  8:55 ` Andreas Dilger
2011-03-21 11:31   ` Rogier Wolff
2011-03-21 13:24   ` Ted Ts'o
2011-03-21 23:42     ` Andreas Dilger
2011-04-05 17:23 ` Coly Li

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=1300570117-24048-5-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).