Skip to contentSkip to conversation

ext4: code cleanup

PATCH New Aneesh Kumar K.V 1 participant 1 message Nov 25, 2008 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: code cleanup

rename some variables . We also unlock locks in the reverse order we acquired as a part of cleanup.

FILENAME: In between use-high-16-bits-of-bg-free-counts fix-race-between-read_inode_bitmap-and-ext4_new_inode

---
 fs/ext4/balloc.c  |    2 +-
 fs/ext4/ialloc.c  |   63 ++++++++++++++++++++++++++++------------------------
 fs/ext4/mballoc.c |    2 +-
 3 files changed, 36 insertions(+), 31 deletions(-)
fs/ext4/balloc.c +1 -1
index 8dd7b0d..3cae4c6 100644
@@ -329,8 +329,8 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
 	if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
 		ext4_init_block_bitmap(sb, bh, block_group, desc);
 		set_buffer_uptodate(bh);
-		unlock_buffer(bh);
 		spin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));
+		unlock_buffer(bh);
 		return bh;
 	}
 	spin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));
fs/ext4/ialloc.c +34 -29

150 lines not on this page · raw message

fs/ext4/mballoc.c +1 -1
index eb6aca6..97a2d4b 100644
@@ -804,8 +804,8 @@ static int ext4_mb_init_cache(struct page *page, char *incore)
 			ext4_init_block_bitmap(sb, bh[i],
 						first_group + i, desc);
 			set_buffer_uptodate(bh[i]);
-			unlock_buffer(bh[i]);
 			spin_unlock(sb_bgl_lock(EXT4_SB(sb), first_group + i));
+			unlock_buffer(bh[i]);
 			continue;
 		}
 		spin_unlock(sb_bgl_lock(EXT4_SB(sb), first_group + i));
Signature · 1 line
1.6.0.4.735.gea4f