diff options
author | Francis Moreau <francis.moro@gmail.com> | 2010-04-08 05:35:17 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:37 -0400 |
commit | 524e4a1d102bdcee37297c0b763e945827b33ab8 (patch) | |
tree | cd4a9de437710fcbc7fdb315c13f5a98e04d9a4f | |
parent | eabf290d1470921f0ce5a9b22464ae30646a0677 (diff) |
ext2: remove useless call to brelse() in ext2_free_inode()
This patch removes a useless call to brelse(bitmap_bh) since at that
point bitmap_bh is NULL and slightly cleans up bitmap_bh handling.
Signed-off-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | 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 ad7d572ee8dc..f0c5286f9342 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
@@ -106,7 +106,7 @@ void ext2_free_inode (struct inode * inode) | |||
106 | struct super_block * sb = inode->i_sb; | 106 | struct super_block * sb = inode->i_sb; |
107 | int is_directory; | 107 | int is_directory; |
108 | unsigned long ino; | 108 | unsigned long ino; |
109 | struct buffer_head *bitmap_bh = NULL; | 109 | struct buffer_head *bitmap_bh; |
110 | unsigned long block_group; | 110 | unsigned long block_group; |
111 | unsigned long bit; | 111 | unsigned long bit; |
112 | struct ext2_super_block * es; | 112 | struct ext2_super_block * es; |
@@ -135,14 +135,13 @@ void ext2_free_inode (struct inode * inode) | |||
135 | ino > le32_to_cpu(es->s_inodes_count)) { | 135 | ino > le32_to_cpu(es->s_inodes_count)) { |
136 | ext2_error (sb, "ext2_free_inode", | 136 | ext2_error (sb, "ext2_free_inode", |
137 | "reserved or nonexistent inode %lu", ino); | 137 | "reserved or nonexistent inode %lu", ino); |
138 | goto error_return; | 138 | return; |
139 | } | 139 | } |
140 | block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb); | 140 | block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb); |
141 | bit = (ino - 1) % EXT2_INODES_PER_GROUP(sb); | 141 | bit = (ino - 1) % EXT2_INODES_PER_GROUP(sb); |
142 | brelse(bitmap_bh); | ||
143 | bitmap_bh = read_inode_bitmap(sb, block_group); | 142 | bitmap_bh = read_inode_bitmap(sb, block_group); |
144 | if (!bitmap_bh) | 143 | if (!bitmap_bh) |
145 | goto error_return; | 144 | return; |
146 | 145 | ||
147 | /* Ok, now we can actually update the inode bitmaps.. */ | 146 | /* Ok, now we can actually update the inode bitmaps.. */ |
148 | if (!ext2_clear_bit_atomic(sb_bgl_lock(EXT2_SB(sb), block_group), | 147 | if (!ext2_clear_bit_atomic(sb_bgl_lock(EXT2_SB(sb), block_group), |
@@ -154,7 +153,7 @@ void ext2_free_inode (struct inode * inode) | |||
154 | mark_buffer_dirty(bitmap_bh); | 153 | mark_buffer_dirty(bitmap_bh); |
155 | if (sb->s_flags & MS_SYNCHRONOUS) | 154 | if (sb->s_flags & MS_SYNCHRONOUS) |
156 | sync_dirty_buffer(bitmap_bh); | 155 | sync_dirty_buffer(bitmap_bh); |
157 | error_return: | 156 | |
158 | brelse(bitmap_bh); | 157 | brelse(bitmap_bh); |
159 | } | 158 | } |
160 | 159 | ||