All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver()
@ 2014-02-24 17:41 Lukas Czerner
  2014-02-24 17:41 ` [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default Lukas Czerner
  2014-07-06  1:09 ` [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver() Theodore Ts'o
  0 siblings, 2 replies; 6+ messages in thread
From: Lukas Czerner @ 2014-02-24 17:41 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, Lukas Czerner

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 misc/mke2fs.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index facbe4c..957b4b6 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -177,7 +177,8 @@ static int parse_version_number(const char *s)
 	return KERNEL_VERSION(major, minor, rev);
 }
 
-static int is_before_linux_ver(unsigned int major, unsigned int minor)
+static int is_before_linux_ver(unsigned int major, unsigned int minor,
+			       unsigned int rev)
 {
 	struct		utsname ut;
 	static int	linux_version_code = -1;
@@ -191,10 +192,11 @@ static int is_before_linux_ver(unsigned int major, unsigned int minor)
 	if (linux_version_code == 0)
 		return 0;
 
-	return linux_version_code < KERNEL_VERSION(major, minor, 0);
+	return linux_version_code < KERNEL_VERSION(major, minor, rev);
 }
 #else
-static int is_before_linux_ver(unsigned int major, unsigned int minor)
+static int is_before_linux_ver(unsigned int major, unsigned int minor,
+			       unsigned int rev)
 {
 	return 0;
 }
@@ -1513,7 +1515,7 @@ profile_error:
 	memset(&fs_param, 0, sizeof(struct ext2_super_block));
 	fs_param.s_rev_level = 1;  /* Create revision 1 filesystems now */
 
-	if (is_before_linux_ver(2, 2))
+	if (is_before_linux_ver(2, 2, 0))
 		fs_param.s_rev_level = 0;
 
 	if (argc && *argv) {
@@ -1952,7 +1954,7 @@ profile_error:
 
 		if (use_bsize == -1) {
 			use_bsize = sys_page_size;
-			if (is_before_linux_ver(2, 6) && use_bsize > 4096)
+			if (is_before_linux_ver(2, 6, 0) && use_bsize > 4096)
 				use_bsize = 4096;
 		}
 		if (lsector_size && use_bsize < lsector_size)
-- 
1.8.3.1


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

* [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default
  2014-02-24 17:41 [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver() Lukas Czerner
@ 2014-02-24 17:41 ` Lukas Czerner
  2014-02-24 17:43   ` Eric Sandeen
  2014-07-06  1:09   ` Theodore Ts'o
  2014-07-06  1:09 ` [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver() Theodore Ts'o
  1 sibling, 2 replies; 6+ messages in thread
From: Lukas Czerner @ 2014-02-24 17:41 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, Lukas Czerner

Currently is used did not specified lazy_itable_init option we rely on
information from ext4 module exported via sysfs interface. However if
the ext4 module is not loaded it will not be enabled even though kernel
might support it.

With this commit we set the default according to the kernel version,
however we still allow it to be set manually via extended option or be
enabled in case that ext4 module advertise that it supports this
feature.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 misc/mke2fs.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 957b4b6..e1c6d09 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2146,7 +2146,15 @@ profile_error:
 			blocksize, sys_page_size);
 	}
 
-	lazy_itable_init = 0;
+	/*
+	 * On newer kernels we do have lazy_itable_init support. So pick the
+	 * right default in case ext4 module is not loaded.
+	 */
+	if (is_before_linux_ver(2, 6, 37))
+		lazy_itable_init = 0;
+	else
+		lazy_itable_init = 1;
+
 	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
 		lazy_itable_init = 1;
 
-- 
1.8.3.1


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

* Re: [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default
  2014-02-24 17:41 ` [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default Lukas Czerner
@ 2014-02-24 17:43   ` Eric Sandeen
  2014-03-03 12:53     ` Lukáš Czerner
  2014-07-06  1:09   ` Theodore Ts'o
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2014-02-24 17:43 UTC (permalink / raw)
  To: Lukas Czerner, linux-ext4; +Cc: tytso

On 2/24/14, 11:41 AM, Lukas Czerner wrote:
> Currently is used did not specified lazy_itable_init option we rely on

s/is used did not specified/if user did not specify/ :)

> information from ext4 module exported via sysfs interface. However if
> the ext4 module is not loaded it will not be enabled even though kernel
> might support it.
> 
> With this commit we set the default according to the kernel version,
> however we still allow it to be set manually via extended option or be
> enabled in case that ext4 module advertise that it supports this
> feature.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Thanks,
Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  misc/mke2fs.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index 957b4b6..e1c6d09 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -2146,7 +2146,15 @@ profile_error:
>  			blocksize, sys_page_size);
>  	}
>  
> -	lazy_itable_init = 0;
> +	/*
> +	 * On newer kernels we do have lazy_itable_init support. So pick the
> +	 * right default in case ext4 module is not loaded.
> +	 */
> +	if (is_before_linux_ver(2, 6, 37))
> +		lazy_itable_init = 0;
> +	else
> +		lazy_itable_init = 1;
> +
>  	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
>  		lazy_itable_init = 1;
>  
> 


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

* Re: [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default
  2014-02-24 17:43   ` Eric Sandeen
@ 2014-03-03 12:53     ` Lukáš Czerner
  0 siblings, 0 replies; 6+ messages in thread
From: Lukáš Czerner @ 2014-03-03 12:53 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4, tytso

On Mon, 24 Feb 2014, Eric Sandeen wrote:

> Date: Mon, 24 Feb 2014 11:43:21 -0600
> From: Eric Sandeen <sandeen@redhat.com>
> To: Lukas Czerner <lczerner@redhat.com>, linux-ext4@vger.kernel.org
> Cc: tytso@mit.edu
> Subject: Re: [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by
>     default
> 
> On 2/24/14, 11:41 AM, Lukas Czerner wrote:
> > Currently is used did not specified lazy_itable_init option we rely on
> 
> s/is used did not specified/if user did not specify/ :)
> 
> > information from ext4 module exported via sysfs interface. However if
> > the ext4 module is not loaded it will not be enabled even though kernel
> > might support it.
> > 
> > With this commit we set the default according to the kernel version,
> > however we still allow it to be set manually via extended option or be
> > enabled in case that ext4 module advertise that it supports this
> > feature.
> > 
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> 
> Thanks,
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>

Hi Ted,

are you planning to take this in ?

Thanks!
-Lukas

> 
> > ---
> >  misc/mke2fs.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> > index 957b4b6..e1c6d09 100644
> > --- a/misc/mke2fs.c
> > +++ b/misc/mke2fs.c
> > @@ -2146,7 +2146,15 @@ profile_error:
> >  			blocksize, sys_page_size);
> >  	}
> >  
> > -	lazy_itable_init = 0;
> > +	/*
> > +	 * On newer kernels we do have lazy_itable_init support. So pick the
> > +	 * right default in case ext4 module is not loaded.
> > +	 */
> > +	if (is_before_linux_ver(2, 6, 37))
> > +		lazy_itable_init = 0;
> > +	else
> > +		lazy_itable_init = 1;
> > +
> >  	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
> >  		lazy_itable_init = 1;
> >  
> > 
> 
> 

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

* Re: [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver()
  2014-02-24 17:41 [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver() Lukas Czerner
  2014-02-24 17:41 ` [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default Lukas Czerner
@ 2014-07-06  1:09 ` Theodore Ts'o
  1 sibling, 0 replies; 6+ messages in thread
From: Theodore Ts'o @ 2014-07-06  1:09 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4

On Mon, Feb 24, 2014 at 06:41:05PM +0100, Lukas Czerner wrote:
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Thanks, applied.

					- Ted

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

* Re: [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default
  2014-02-24 17:41 ` [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default Lukas Czerner
  2014-02-24 17:43   ` Eric Sandeen
@ 2014-07-06  1:09   ` Theodore Ts'o
  1 sibling, 0 replies; 6+ messages in thread
From: Theodore Ts'o @ 2014-07-06  1:09 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4

On Mon, Feb 24, 2014 at 06:41:06PM +0100, Lukas Czerner wrote:
> Currently is used did not specified lazy_itable_init option we rely on
> information from ext4 module exported via sysfs interface. However if
> the ext4 module is not loaded it will not be enabled even though kernel
> might support it.
> 
> With this commit we set the default according to the kernel version,
> however we still allow it to be set manually via extended option or be
> enabled in case that ext4 module advertise that it supports this
> feature.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Thanks, applied.

					- Ted

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

end of thread, other threads:[~2014-07-06  1:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 17:41 [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver() Lukas Czerner
2014-02-24 17:41 ` [PATCH 2/2] mke2fs: Enable lazy_itable_init on newer kernel by default Lukas Czerner
2014-02-24 17:43   ` Eric Sandeen
2014-03-03 12:53     ` Lukáš Czerner
2014-07-06  1:09   ` Theodore Ts'o
2014-07-06  1:09 ` [PATCH 1/2] mke2fs: Add revision to the is_before_linux_ver() Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.