- make things static - whitespace fixes - set s_dirt when we alter the per-blockgroup inode counters. We still owe the fs a superblock flush. fs/ext2/ialloc.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff -puN fs/ext2/ialloc.c~ext2-ialloc-no-lock_super-fixes fs/ext2/ialloc.c --- 25/fs/ext2/ialloc.c~ext2-ialloc-no-lock_super-fixes 2003-03-15 14:05:43.000000000 -0800 +++ 25-akpm/fs/ext2/ialloc.c 2003-03-15 14:05:43.000000000 -0800 @@ -63,7 +63,17 @@ error_out: return bh; } -void ext2_reserve_inode (struct super_block * sb, int group, int dir) +/* + * Speculatively reserve an inode in a blockgroup which used to have some + * spare ones. Later, when we come to actually claim the inode in the bitmap + * it may be that it was taken. In that case the allocator will undo this + * reservation and try again. + * + * The inode allocator does not physically alter the superblock. But we still + * set sb->s_dirt, because the superblock was "logically" altered - we need to + * go and add up the free inodes counts again and flush out the superblock. + */ +static void ext2_reserve_inode(struct super_block *sb, int group, int dir) { struct ext2_group_desc * desc; struct buffer_head *bh; @@ -72,7 +82,7 @@ void ext2_reserve_inode (struct super_bl if (!desc) { ext2_error(sb, "ext2_reserve_inode", "can't get descriptor for group %d", group); - return; + return; } spin_lock(&EXT2_SB(sb)->s_bgi[group].ialloc_lock); @@ -82,11 +92,11 @@ void ext2_reserve_inode (struct super_bl desc->bg_used_dirs_count = cpu_to_le16(le16_to_cpu(desc->bg_used_dirs_count) + 1); spin_unlock(&EXT2_SB(sb)->s_bgi[group].ialloc_lock); - + sb->s_dirt = 1; mark_buffer_dirty(bh); } -void ext2_release_inode (struct super_block * sb, int group, int dir) +static void ext2_release_inode(struct super_block *sb, int group, int dir) { struct ext2_group_desc * desc; struct buffer_head *bh; @@ -105,7 +115,7 @@ void ext2_release_inode (struct super_bl desc->bg_used_dirs_count = cpu_to_le16(le16_to_cpu(desc->bg_used_dirs_count) - 1); spin_unlock(&EXT2_SB(sb)->s_bgi[group].ialloc_lock); - + sb->s_dirt = 1; mark_buffer_dirty(bh); } _