Projects
Mega:24.09
xfsprogs
_service:tar_scm:xfsprogs-5.12.0-default-bigtim...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:xfsprogs-5.12.0-default-bigtime-inobtcnt-on.patch of Package xfsprogs
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index c522cb4..4f16335 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -14,7 +14,9 @@ #include "libfrog/dahashselftest.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))) #define MEGABYTES(count, blog) ((uint64_t)(count) << (20 - (blog))) @@ -4072,6 +4074,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, @@ -4150,7 +4169,15 @@ main( }; 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]);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2