From: Lukas Czerner Date: Thu, 18 Nov 2010 13:38:41 +0000 (+0100) Subject: mke2fs: Add discard option into mke2fs.conf X-Git-Tag: v1.41.13~14 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=7fe5ff3c1e06c4705a7a709a7ed34f02c5a02fd8;p=tools%2Fe2fsprogs.git mke2fs: Add discard option into mke2fs.conf 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 Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index ec4a810..9a7e287 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -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++) { diff --git a/misc/mke2fs.conf.5.in b/misc/mke2fs.conf.5.in index c1b54f7..dfc0695 100644 --- a/misc/mke2fs.conf.5.in +++ b/misc/mke2fs.conf.5.in @@ -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