aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-03-31 08:22:10 -0400
committerJan Kara <jack@suse.cz>2012-04-11 05:12:45 -0400
commitb838ec2232b764a4903707e212c62f681b32cd51 (patch)
tree31967c9821f019d97fdb6882a0b31d41db3d10e5 /fs/ext2
parentf2b2242081314ee4385f3b49d92b0adff8324d80 (diff)
ext2: Remove s_dirt handling
Places which modify superblock feature / state fields mark the superblock buffer dirty so it is written out by flusher thread. Thus there's no need to set s_dirt there. The only other fields changing in the superblock are the numbers of free blocks, free inodes and s_wtime. There's no real need to write (or even compute) these periodically. Free blocks / inodes counters are recomputed on every mount from group counters anyway and value of s_wtime is only informational and imprecise anyway. So it should be enough to write these opportunistically on mount, remount, umount, and sync_fs times. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/balloc.c2
-rw-r--r--fs/ext2/ialloc.c2
-rw-r--r--fs/ext2/super.c3
-rw-r--r--fs/ext2/xattr.c1
4 files changed, 0 insertions, 8 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index a8cbe1bc6ad4..a9bba1e39200 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -165,7 +165,6 @@ static void release_blocks(struct super_block *sb, int count)
165 struct ext2_sb_info *sbi = EXT2_SB(sb); 165 struct ext2_sb_info *sbi = EXT2_SB(sb);
166 166
167 percpu_counter_add(&sbi->s_freeblocks_counter, count); 167 percpu_counter_add(&sbi->s_freeblocks_counter, count);
168 sb->s_dirt = 1;
169 } 168 }
170} 169}
171 170
@@ -180,7 +179,6 @@ static void group_adjust_blocks(struct super_block *sb, int group_no,
180 free_blocks = le16_to_cpu(desc->bg_free_blocks_count); 179 free_blocks = le16_to_cpu(desc->bg_free_blocks_count);
181 desc->bg_free_blocks_count = cpu_to_le16(free_blocks + count); 180 desc->bg_free_blocks_count = cpu_to_le16(free_blocks + count);
182 spin_unlock(sb_bgl_lock(sbi, group_no)); 181 spin_unlock(sb_bgl_lock(sbi, group_no));
183 sb->s_dirt = 1;
184 mark_buffer_dirty(bh); 182 mark_buffer_dirty(bh);
185 } 183 }
186} 184}
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index 8b15cf8cef37..c13eb7b91a11 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -81,7 +81,6 @@ static void ext2_release_inode(struct super_block *sb, int group, int dir)
81 spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); 81 spin_unlock(sb_bgl_lock(EXT2_SB(sb), group));
82 if (dir) 82 if (dir)
83 percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); 83 percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter);
84 sb->s_dirt = 1;
85 mark_buffer_dirty(bh); 84 mark_buffer_dirty(bh);
86} 85}
87 86
@@ -543,7 +542,6 @@ got:
543 } 542 }
544 spin_unlock(sb_bgl_lock(sbi, group)); 543 spin_unlock(sb_bgl_lock(sbi, group));
545 544
546 sb->s_dirt = 1;
547 mark_buffer_dirty(bh2); 545 mark_buffer_dirty(bh2);
548 if (test_opt(sb, GRPID)) { 546 if (test_opt(sb, GRPID)) {
549 inode->i_mode = mode; 547 inode->i_mode = mode;
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 12a7916cfa9d..a43f9adcc811 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1158,7 +1158,6 @@ static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es,
1158 mark_buffer_dirty(EXT2_SB(sb)->s_sbh); 1158 mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
1159 if (wait) 1159 if (wait)
1160 sync_dirty_buffer(EXT2_SB(sb)->s_sbh); 1160 sync_dirty_buffer(EXT2_SB(sb)->s_sbh);
1161 sb->s_dirt = 0;
1162} 1161}
1163 1162
1164/* 1163/*
@@ -1191,8 +1190,6 @@ void ext2_write_super(struct super_block *sb)
1191{ 1190{
1192 if (!(sb->s_flags & MS_RDONLY)) 1191 if (!(sb->s_flags & MS_RDONLY))
1193 ext2_sync_fs(sb, 1); 1192 ext2_sync_fs(sb, 1);
1194 else
1195 sb->s_dirt = 0;
1196} 1193}
1197 1194
1198static int ext2_remount (struct super_block * sb, int * flags, char * data) 1195static int ext2_remount (struct super_block * sb, int * flags, char * data)
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 6dcafc7efdfd..b6754dbbce3c 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -339,7 +339,6 @@ static void ext2_xattr_update_super_block(struct super_block *sb)
339 spin_lock(&EXT2_SB(sb)->s_lock); 339 spin_lock(&EXT2_SB(sb)->s_lock);
340 EXT2_SET_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR); 340 EXT2_SET_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR);
341 spin_unlock(&EXT2_SB(sb)->s_lock); 341 spin_unlock(&EXT2_SB(sb)->s_lock);
342 sb->s_dirt = 1;
343 mark_buffer_dirty(EXT2_SB(sb)->s_sbh); 342 mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
344} 343}
345 344