Whamcloud - gitweb
mke2fs: Add discard option into mke2fs.conf
authorLukas Czerner <lczerner@redhat.com>
Thu, 18 Nov 2010 13:38:41 +0000 (14:38 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 22 Nov 2010 21:15:16 +0000 (16:15 -0500)
Allow to specify discard in mke2fs.conf. Also change the way how to
specify default value for lazy_itable_init. It is better to have all
this defaulting done in the same place so do it in definition (as we do
with discard).

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/mke2fs.c
misc/mke2fs.conf.5.in

index ec4a810..9a7e287 100644 (file)
@@ -80,12 +80,12 @@ int cflag;
 int    verbose;
 int    quiet;
 int    super_only;
-int    discard = 1;
+int    discard = 1;    /* attempt to discard device before fs creation */
 int    force;
 int    noaction;
 int    journal_size;
 int    journal_flags;
-int    lazy_itable_init;       /* use lazy inode table init */
+int    lazy_itable_init;
 char   *bad_blocks_filename;
 __u32  fs_stride;
 
@@ -1749,6 +1749,7 @@ got_size:
        lazy_itable_init = get_bool_from_profile(fs_types,
                                                 "lazy_itable_init",
                                                 lazy_itable_init);
+       discard = get_bool_from_profile(fs_types, "discard" , discard);
 
        /* Get options from profile */
        for (cpp = fs_types; *cpp; cpp++) {
index c1b54f7..dfc0695 100644 (file)
@@ -352,6 +352,11 @@ option.  This can be used to configure the default extended options used
 by
 .BR mke2fs (8)
 on a per-filesystem type basis.
+.TP
+.I discard
+This relation is a boolean which specifies whether the
+.BR mke2fs (8)
+should attempt to discard device prior to filesystem creation.
 .SH FILES
 .TP
 .I /etc/mke2fs.conf