linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francis Moreau <francis.moro@gmail.com>
To: linux-fsdevel@vger.kernel.org
Subject: [PATCH] ext2_free_inode(): remove useless call to brelse()
Date: Fri, 26 Mar 2010 14:07:00 +0100	[thread overview]
Message-ID: <38b2ab8a1003260607p42382139te0be1a4ba4b3b8bc@mail.gmail.com> (raw)

This patch removes a useless call to brelse(bitmap_bh) since at that
point bitmap_bh is NULL.

It also converts the last brelse(bitmap_bh) into a __brelse(bitmap_bh)
since at that point bitmap_bh is no more NULL.

Signed-off-by: Francis Moreau <francis.moro@gmail.com>
---
 fs/ext2/ialloc.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index ad7d572..5addd35 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -135,14 +135,13 @@ void ext2_free_inode (struct inode * inode)
 	    ino > le32_to_cpu(es->s_inodes_count)) {
 		ext2_error (sb, "ext2_free_inode",
 			    "reserved or nonexistent inode %lu", ino);
-		goto error_return;
+		return;
 	}
 	block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb);
 	bit = (ino - 1) % EXT2_INODES_PER_GROUP(sb);
-	brelse(bitmap_bh);
 	bitmap_bh = read_inode_bitmap(sb, block_group);
 	if (!bitmap_bh)
-		goto error_return;
+		return;

 	/* Ok, now we can actually update the inode bitmaps.. */
 	if (!ext2_clear_bit_atomic(sb_bgl_lock(EXT2_SB(sb), block_group),
@@ -154,8 +153,8 @@ void ext2_free_inode (struct inode * inode)
 	mark_buffer_dirty(bitmap_bh);
 	if (sb->s_flags & MS_SYNCHRONOUS)
 		sync_dirty_buffer(bitmap_bh);
-error_return:
-	brelse(bitmap_bh);
+
+	__brelse(bitmap_bh);
 }

 /*
-- 
1.6.6

             reply	other threads:[~2010-03-26 13:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 13:07 Francis Moreau [this message]
2010-04-08  9:57 ` [PATCH] ext2_free_inode(): remove useless call to brelse() Jan Kara
2010-04-08 10:01   ` Jan Kara
2010-04-13  9:02     ` Francis Moreau

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=38b2ab8a1003260607p42382139te0be1a4ba4b3b8bc@mail.gmail.com \
    --to=francis.moro@gmail.com \
    --cc=linux-fsdevel@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).