Blame SOURCES/e2fsprogs-1.42.9-add-revision-to-the-is_before_linux_ver.patch

98901c
From b78d235914708decce36519e1a65705ba4f04cdb Mon Sep 17 00:00:00 2001
98901c
From: Lukas Czerner <lczerner@redhat.com>
98901c
Date: Mon, 24 Feb 2014 18:41:05 +0100
98901c
Subject: [PATCH 2/8] mke2fs: Add revision to the is_before_linux_ver()
98901c
98901c
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
98901c
---
98901c
 misc/mke2fs.c | 12 +++++++-----
98901c
 1 file changed, 7 insertions(+), 5 deletions(-)
98901c
98901c
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
98901c
index 2afcb05..e970bbe 100644
98901c
--- a/misc/mke2fs.c
98901c
+++ b/misc/mke2fs.c
98901c
@@ -172,7 +172,8 @@ static int parse_version_number(const char *s)
98901c
 	return KERNEL_VERSION(major, minor, rev);
98901c
 }
98901c
 
98901c
-static int is_before_linux_ver(unsigned int major, unsigned int minor)
98901c
+static int is_before_linux_ver(unsigned int major, unsigned int minor,
98901c
+			       unsigned int rev)
98901c
 {
98901c
 	struct		utsname ut;
98901c
 	static int	linux_version_code = -1;
98901c
@@ -186,10 +187,11 @@ static int is_before_linux_ver(unsigned int major, unsigned int minor)
98901c
 	if (linux_version_code == 0)
98901c
 		return 0;
98901c
 
98901c
-	return linux_version_code < KERNEL_VERSION(major, minor, 0);
98901c
+	return linux_version_code < KERNEL_VERSION(major, minor, rev);
98901c
 }
98901c
 #else
98901c
-static int is_before_linux_ver(unsigned int major, unsigned int minor)
98901c
+static int is_before_linux_ver(unsigned int major, unsigned int minor,
98901c
+			       unsigned int rev)
98901c
 {
98901c
 	return 0;
98901c
 }
98901c
@@ -1394,7 +1396,7 @@ profile_error:
98901c
 	memset(&fs_param, 0, sizeof(struct ext2_super_block));
98901c
 	fs_param.s_rev_level = 1;  /* Create revision 1 filesystems now */
98901c
 
98901c
-	if (is_before_linux_ver(2, 2))
98901c
+	if (is_before_linux_ver(2, 2, 0))
98901c
 		fs_param.s_rev_level = 0;
98901c
 
98901c
 	if (argc && *argv) {
98901c
@@ -1803,7 +1805,7 @@ profile_error:
98901c
 
98901c
 		if (use_bsize == -1) {
98901c
 			use_bsize = sys_page_size;
98901c
-			if (is_before_linux_ver(2, 6) && use_bsize > 4096)
98901c
+			if (is_before_linux_ver(2, 6, 0) && use_bsize > 4096)
98901c
 				use_bsize = 4096;
98901c
 		}
98901c
 		if (lsector_size && use_bsize < lsector_size)
98901c
-- 
98901c
1.8.3.1
98901c