1 ext4: introduce own superblock dirty flag
3 From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
5 We finally do not need VFS's 's_dirt' flag in ext4 - introduce our own
6 's_dirty' flag instead.
8 Note: the final goal is to get rid of the 'sync_supers()' kernel
9 thread which wakes up every 5 seconds and even if there is nothing to
10 do. Thus, we are pushing superblock management from VFS down to
13 Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
14 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 fs/ext4/super.c | 12 ++++++------
18 2 files changed, 7 insertions(+), 6 deletions(-)
20 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
21 index 87e8376..be15b2d 100644
24 @@ -1158,6 +1158,7 @@ struct ext4_sb_info {
26 int s_def_hash_version;
27 int s_hash_unsigned; /* 3 if hash should be signed, 0 if not */
29 struct percpu_counter s_freeclusters_counter;
30 struct percpu_counter s_freeinodes_counter;
31 struct percpu_counter s_dirs_counter;
32 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
33 index 64f3a6a..e24dec2 100644
36 @@ -824,7 +824,7 @@ static void ext4_put_super(struct super_block *sb)
37 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
38 es->s_state = cpu_to_le16(sbi->s_mount_state);
40 - if (sb->s_dirt || !(sb->s_flags & MS_RDONLY))
41 + if (sbi->s_dirty || !(sb->s_flags & MS_RDONLY))
42 ext4_commit_super(sb, 1);
45 @@ -4140,7 +4140,7 @@ static int ext4_commit_super(struct super_block *sb, int sync)
46 if (!sbh || block_device_ejected(sb))
52 * Make sure we first mark the superblock as clean and then start
54 @@ -4225,7 +4225,7 @@ static void write_super(struct work_struct *work)
59 + if (!EXT4_SB(sb)->s_dirty)
63 @@ -4241,9 +4241,9 @@ void __ext4_mark_super_dirty(struct super_block *sb)
65 /* Make sure we see 's_dirt' changes ASAP */
67 - if (sb->s_dirt == 1)
68 + if (sbi->s_dirty == 1)
72 /* Make other CPUs see the 's_dirt' change as soon as possible */
75 @@ -4254,7 +4254,7 @@ void __ext4_mark_super_dirty(struct super_block *sb)
76 * trouble anyway, and the SB will be written out on unmount or
77 * we may be luckier next time it is marked as dirty.