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