aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2008-07-11 19:27:31 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-07-11 19:27:31 -0400
commitdd919b9822c5fd9fd72f95a602440130297c3857 (patch)
treeda1958f89e5671cc7b16e0c45630c310c9b3b5bd /fs/ext4
parent3e3398a08d6e516675d5af853d625dc7dd90eab1 (diff)
ext4: Enable delalloc by default.
Enable delalloc by default to ensure it gets sufficient testing and because it makes the filesystem much more efficient. Add a nodealalloc option to disable delayed allocation, and update ext4_show_options to show delayed allocation off if it is disabled. If the data=journal mount option is used, disable delayed allocation since the delalloc code doesn't support data=journal yet. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 25e2f2488cd2..4e104dd0ec21 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -756,6 +756,9 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
756 seq_puts(seq, ",nomballoc"); 756 seq_puts(seq, ",nomballoc");
757 if (test_opt(sb, I_VERSION)) 757 if (test_opt(sb, I_VERSION))
758 seq_puts(seq, ",i_version"); 758 seq_puts(seq, ",i_version");
759 if (!test_opt(sb, DELALLOC))
760 seq_puts(seq, ",nodelalloc");
761
759 762
760 if (sbi->s_stripe) 763 if (sbi->s_stripe)
761 seq_printf(seq, ",stripe=%lu", sbi->s_stripe); 764 seq_printf(seq, ",stripe=%lu", sbi->s_stripe);
@@ -903,7 +906,7 @@ enum {
903 Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, 906 Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
904 Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, 907 Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
905 Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version, 908 Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
906 Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_delalloc, 909 Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_delalloc, Opt_nodelalloc,
907}; 910};
908 911
909static match_table_t tokens = { 912static match_table_t tokens = {
@@ -963,6 +966,7 @@ static match_table_t tokens = {
963 {Opt_stripe, "stripe=%u"}, 966 {Opt_stripe, "stripe=%u"},
964 {Opt_resize, "resize"}, 967 {Opt_resize, "resize"},
965 {Opt_delalloc, "delalloc"}, 968 {Opt_delalloc, "delalloc"},
969 {Opt_nodelalloc, "nodelalloc"},
966 {Opt_err, NULL}, 970 {Opt_err, NULL},
967}; 971};
968 972
@@ -1328,6 +1332,9 @@ set_qf_format:
1328 set_opt(sbi->s_mount_opt, I_VERSION); 1332 set_opt(sbi->s_mount_opt, I_VERSION);
1329 sb->s_flags |= MS_I_VERSION; 1333 sb->s_flags |= MS_I_VERSION;
1330 break; 1334 break;
1335 case Opt_nodelalloc:
1336 clear_opt(sbi->s_mount_opt, DELALLOC);
1337 break;
1331 case Opt_mballoc: 1338 case Opt_mballoc:
1332 set_opt(sbi->s_mount_opt, MBALLOC); 1339 set_opt(sbi->s_mount_opt, MBALLOC);
1333 break; 1340 break;
@@ -1984,6 +1991,13 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1984 */ 1991 */
1985 set_opt(sbi->s_mount_opt, MBALLOC); 1992 set_opt(sbi->s_mount_opt, MBALLOC);
1986 1993
1994 /*
1995 * enable delayed allocation by default
1996 * Use -o nodelalloc to turn it off
1997 */
1998 set_opt(sbi->s_mount_opt, DELALLOC);
1999
2000
1987 if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum, 2001 if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
1988 NULL, 0)) 2002 NULL, 0))
1989 goto failed_mount; 2003 goto failed_mount;
@@ -2422,6 +2436,13 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
2422 test_opt(sb,DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered": 2436 test_opt(sb,DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered":
2423 "writeback"); 2437 "writeback");
2424 2438
2439 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
2440 printk(KERN_WARNING "EXT4-fs: Ignoring delalloc option - "
2441 "requested data journaling mode\n");
2442 clear_opt(sbi->s_mount_opt, DELALLOC);
2443 } else if (test_opt(sb, DELALLOC))
2444 printk(KERN_INFO "EXT4-fs: delayed allocation enabled\n");
2445
2425 ext4_ext_init(sb); 2446 ext4_ext_init(sb);
2426 ext4_mb_init(sb, needs_recovery); 2447 ext4_mb_init(sb, needs_recovery);
2427 2448