aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-02-02 00:37:02 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-02-05 02:45:00 -0500
commita26f49926da938f47561f386be56a83dd37a496d (patch)
tree00d84a2406137aab5cc4b8ed290f962608558d70 /fs/ext4/super.c
parentfe032c422c5ba562ba9c2d316f55e258e03259c6 (diff)
ext4: add optimization for the lazytime mount option
Add an optimization for the MS_LAZYTIME mount option so that we will opportunistically write out any inodes with the I_DIRTY_TIME flag set in a particular inode table block when we need to update some inode in that inode table block anyway. Also add some temporary code so that we can set the lazytime mount option without needing a modified /sbin/mount program which can set MS_LAZYTIME. We can eventually make this go away once util-linux has added support. Google-Bug-Id: 18297052 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 74c5f53595fb..362b23c8497a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1139,6 +1139,7 @@ enum {
1139 Opt_noquota, Opt_barrier, Opt_nobarrier, Opt_err, 1139 Opt_noquota, Opt_barrier, Opt_nobarrier, Opt_err,
1140 Opt_usrquota, Opt_grpquota, Opt_i_version, 1140 Opt_usrquota, Opt_grpquota, Opt_i_version,
1141 Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, 1141 Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit,
1142 Opt_lazytime, Opt_nolazytime,
1142 Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, 1143 Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity,
1143 Opt_inode_readahead_blks, Opt_journal_ioprio, 1144 Opt_inode_readahead_blks, Opt_journal_ioprio,
1144 Opt_dioread_nolock, Opt_dioread_lock, 1145 Opt_dioread_nolock, Opt_dioread_lock,
@@ -1202,6 +1203,8 @@ static const match_table_t tokens = {
1202 {Opt_i_version, "i_version"}, 1203 {Opt_i_version, "i_version"},
1203 {Opt_stripe, "stripe=%u"}, 1204 {Opt_stripe, "stripe=%u"},
1204 {Opt_delalloc, "delalloc"}, 1205 {Opt_delalloc, "delalloc"},
1206 {Opt_lazytime, "lazytime"},
1207 {Opt_nolazytime, "nolazytime"},
1205 {Opt_nodelalloc, "nodelalloc"}, 1208 {Opt_nodelalloc, "nodelalloc"},
1206 {Opt_removed, "mblk_io_submit"}, 1209 {Opt_removed, "mblk_io_submit"},
1207 {Opt_removed, "nomblk_io_submit"}, 1210 {Opt_removed, "nomblk_io_submit"},
@@ -1459,6 +1462,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
1459 case Opt_i_version: 1462 case Opt_i_version:
1460 sb->s_flags |= MS_I_VERSION; 1463 sb->s_flags |= MS_I_VERSION;
1461 return 1; 1464 return 1;
1465 case Opt_lazytime:
1466 sb->s_flags |= MS_LAZYTIME;
1467 return 1;
1468 case Opt_nolazytime:
1469 sb->s_flags &= ~MS_LAZYTIME;
1470 return 1;
1462 } 1471 }
1463 1472
1464 for (m = ext4_mount_opts; m->token != Opt_err; m++) 1473 for (m = ext4_mount_opts; m->token != Opt_err; m++)
@@ -5020,6 +5029,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
5020 } 5029 }
5021#endif 5030#endif
5022 5031
5032 *flags = (*flags & ~MS_LAZYTIME) | (sb->s_flags & MS_LAZYTIME);
5023 ext4_msg(sb, KERN_INFO, "re-mounted. Opts: %s", orig_data); 5033 ext4_msg(sb, KERN_INFO, "re-mounted. Opts: %s", orig_data);
5024 kfree(orig_data); 5034 kfree(orig_data);
5025 return 0; 5035 return 0;