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