aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-06-11 23:14:04 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-06-11 23:14:04 -0400
commita0375156ca1041574b5d47cc7e32f10b891151b0 (patch)
treeb791961012b9348f289c3dda5dc071bdf9b736d2 /fs/ext4/ext4.h
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
ext4: Clean up s_dirt handling
We don't need to set s_dirt in most of the ext4 code when journaling is enabled. In ext3/4 some of the summary statistics for # of free inodes, blocks, and directories are calculated from the per-block group statistics when the file system is mounted or unmounted. As a result the superblock doesn't have to be updated, either via the journal or by setting s_dirt. There are a few exceptions, most notably when resizing the file system, where the superblock needs to be modified --- and in that case it should be done as a journalled operation if possible, and s_dirt set only in no-journal mode. This patch will optimize out some unneeded disk writes when using ext4 with a journal. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 19a4de57128a..8b56b53328eb 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1860,6 +1860,12 @@ static inline void ext4_unlock_group(struct super_block *sb,
1860 spin_unlock(ext4_group_lock_ptr(sb, group)); 1860 spin_unlock(ext4_group_lock_ptr(sb, group));
1861} 1861}
1862 1862
1863static inline void ext4_mark_super_dirty(struct super_block *sb)
1864{
1865 if (EXT4_SB(sb)->s_journal == NULL)
1866 sb->s_dirt =1;
1867}
1868
1863/* 1869/*
1864 * Inodes and files operations 1870 * Inodes and files operations
1865 */ 1871 */