!28 设置bigtime、inobtcnt 默认值为1

From: @xiongyu-net 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
This commit is contained in:
openeuler-ci-bot 2022-06-10 13:11:39 +00:00 committed by Gitee
commit a313321ee1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 91 additions and 1 deletions

View File

@ -0,0 +1,85 @@
--- xfsprogs-5.12.0.orig/man/man8/mkfs.xfs.8
+++ xfsprogs-5.12.0/man/man8/mkfs.xfs.8
@@ -203,7 +203,7 @@ December 1901 to January 2038, and quota
.IP
By default,
.B mkfs.xfs
-will not enable this feature.
+in openeuler will enable this feature.
If the option
.B \-m crc=0
is used, the large timestamp feature is not supported and is disabled.
@@ -256,7 +256,7 @@ This can be used to reduce mount times w
.IP
By default,
.B mkfs.xfs
-will not enable this option.
+in openeuler will enable this option.
This feature is only available for filesystems created with the (default)
.B \-m finobt=1
option set.
--- xfsprogs-5.12.0.orig/mkfs/xfs_mkfs.c
+++ xfsprogs-5.12.0/mkfs/xfs_mkfs.c
@@ -3795,6 +3797,23 @@ cfgfile_parse(
cli->cfgfile);
}
+static unsigned int get_system_kver(void)
+{
+ const char *kver = getenv("KVER");
+ struct utsname utsname;
+ int a, b, c;
+
+ if (!kver) {
+ uname(&utsname);
+ kver = utsname.release;
+ }
+
+ if (sscanf(kver, "%d.%d.%d", &a, &b, &c) != 3)
+ return LINUX_VERSION_CODE;
+
+ return KERNEL_VERSION(a,b,c);
+}
+
int
main(
int argc,
@@ -3848,17 +3867,25 @@ main(
.spinodes = true,
.rmapbt = false,
.reflink = true,
- .inobtcnt = false,
+ .inobtcnt = true,
.parent_pointers = false,
.nodalign = false,
.nortalign = false,
- .bigtime = false,
+ .bigtime = true,
},
};
struct list_head buffer_list;
+ unsigned int kver;
int error;
+ /* turn bigtime & inobtcnt back off if running under older kernels */
+ kver = get_system_kver();
+ if (kver < KERNEL_VERSION(5,10,0)) {
+ dft.sb_feat.inobtcnt = false;
+ dft.sb_feat.bigtime = false;
+ }
+
platform_uuid_generate(&cli.uuid);
progname = basename(argv[0]);
setlocale(LC_ALL, "");
--- xfsprogs-5.14.0/mkfs/xfs_mkfs.c.orig
+++ xfsprogs-5.14.0/mkfs/xfs_mkfs.c
@@ -12,6 +12,8 @@
#include "libfrog/convert.h"
#include "proto.h"
#include <ini.h>
+#include <linux/version.h>
+#include <sys/utsname.h>
#define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog)))
#define GIGABYTES(count, blog) ((uint64_t)(count) << (30 - (blog)))

View File

@ -1,6 +1,6 @@
Name: xfsprogs
Version: 5.14.1
Release: 1
Release: 2
Summary: Administration and debugging tools for the XFS file system
License: GPL+ and LGPLv2+
URL: https://xfs.wiki.kernel.org
@ -17,6 +17,8 @@ Provides: xfsprogs-qa-devel
Obsoletes: xfsprogs-qa-devel <= %{version}
Conflicts: xfsdump < 3.0.1
Patch0: xfsprogs-5.12.0-default-bigtime-inobtcnt-on.patch
%description
xfsprogs are the userspace utilities that manage XFS filesystems.
@ -99,6 +101,9 @@ rm -rf %{buildroot}%{_datadir}/doc/xfsprogs/
%changelog
* Fri Jun 10 2022 xiongyu <xiongyu.net@qq.com> - 5.14.1-2
- turn bigtime & inobtcnt on as default
* Mon Dec 6 2021 yanglongkang <yanglongkang@huawei.com> - 5.14.1-1
- update package to 5.14.1