linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mke2fs: Add discard option into mke2fs.conf
@ 2010-11-01 18:34 Lukas Czerner
  2010-12-02  8:44 ` Lukas Czerner
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Czerner @ 2010-11-01 18:34 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, sandeen, adilger, lczerner

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>
---
 misc/mke2fs.c         |    9 +++++----
 misc/mke2fs.conf.5.in |    5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index f0ac741..960c837 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -83,12 +83,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 = 0;	/* do not use lazy inode table init */
 char	*bad_blocks_filename;
 __u32	fs_stride;
 
@@ -1686,8 +1686,9 @@ static void PRS(int argc, char *argv[])
 
 	blocksize = EXT2_BLOCK_SIZE(&fs_param);
 
-	lazy_itable_init = get_bool_from_profile(fs_types,
-						 "lazy_itable_init", 0);
+	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 d212947..e9913cb 100644
--- a/misc/mke2fs.conf.5.in
+++ b/misc/mke2fs.conf.5.in
@@ -360,6 +360,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
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-03 22:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-01 18:34 [PATCH] mke2fs: Add discard option into mke2fs.conf Lukas Czerner
2010-12-02  8:44 ` Lukas Czerner
2010-12-03 22:29   ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).