Skip to contentSkip to conversation

mke2fs: Add discard option into mke2fs.conf

PATCH In review Lukas Czerner 2 participants 3 messages Nov 1, 2010 – Dec 3, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

---
 misc/mke2fs.c         |    9 +++++----
 misc/mke2fs.conf.5.in |    5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)
misc/mke2fs.c +5 -4
index f0ac741..960c837 100644
@@ -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++) {
misc/mke2fs.conf.5.in +5 -0
index d212947..e9913cb 100644
@@ -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
Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 49 lines · Lukas Czerner

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).

---
 misc/mke2fs.c         |    9 +++++----
 misc/mke2fs.conf.5.in |    5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)
misc/mke2fs.c +5 -4
index f0ac741..960c837 100644
@@ -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++) {
misc/mke2fs.conf.5.in +0 -0
index d212947..e9913cb 100644
@@ -360,6 +360,11 @@ option.  This can be used to configure the default extended options used
 by

misc/mke2fs.conf.5.in option. This can be used to configure the default extended options used · line 370

Quoted 10 lines
misc/mke2fs.conf.5.in +5 -0
 .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

Hi Ted,

what is the status of this patch ?

Thanks!

-Lukas

#2 lore raw
Quoted 9 lines · Lukas Czerner
Quoted 5 lines · Lukas Czerner

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).

what is the status of this patch ?

Already integrated into the maint branch; sorry, forgot to send out an ack for this patch.

- Ted