Blame SOURCES/e2fsprogs-1.42.9-enable-lazy_itable_init-on-newer-kernel-by-default.patch

252946
From 165af99c57a686444167fcef56f9fae31d815887 Mon Sep 17 00:00:00 2001
252946
From: Lukas Czerner <lczerner@redhat.com>
252946
Date: Mon, 24 Feb 2014 18:41:06 +0100
252946
Subject: [PATCH 4/8] mke2fs: Enable lazy_itable_init on newer kernel by
252946
 default
252946
252946
Currently is used did not specified lazy_itable_init option we rely on
252946
information from ext4 module exported via sysfs interface. However if
252946
the ext4 module is not loaded it will not be enabled even though kernel
252946
might support it.
252946
252946
With this commit we set the default according to the kernel version,
252946
however we still allow it to be set manually via extended option or be
252946
enabled in case that ext4 module advertise that it supports this
252946
feature.
252946
252946
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
252946
---
252946
 misc/mke2fs.c | 10 +++++++++-
252946
 1 file changed, 9 insertions(+), 1 deletion(-)
252946
252946
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
252946
index 76ea60b..23a988e 100644
252946
--- a/misc/mke2fs.c
252946
+++ b/misc/mke2fs.c
252946
@@ -1998,7 +1998,15 @@ profile_error:
252946
 			blocksize, sys_page_size);
252946
 	}
252946
 
252946
-	lazy_itable_init = 0;
252946
+	/*
252946
+	 * On newer kernels we do have lazy_itable_init support. So pick the
252946
+	 * right default in case ext4 module is not loaded.
252946
+	 */
252946
+	if (is_before_linux_ver(2, 6, 37))
252946
+		lazy_itable_init = 0;
252946
+	else
252946
+		lazy_itable_init = 1;
252946
+
252946
 	if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
252946
 		lazy_itable_init = 1;
252946
 
252946
-- 
252946
1.8.3.1
252946