summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorAlban Crequy <alban@kinvolk.io>2015-12-07 01:10:50 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-26 12:05:29 -0400
commit099619957a0d9ae0e6e5e221493e40fb8fc2cd81 (patch)
tree5fb572958a5cecf98821f08a9b3bbd787038975c /src/basic
parent09541e49ebd17b41482e447dd8194942f39788c0 (diff)
cgroup2: use new fstype for unified hierarchy
Since Linux v4.4-rc1, __DEVEL__sane_behavior does not exist anymore and is replaced by a new fstype "cgroup2". With this patch, systemd no longer supports the old (unstable) way of doing unified hierarchy with __DEVEL__sane_behavior and systemd now requires Linux v4.4 for unified hierarchy. Non-unified hierarchy is still the default and is unchanged by this patch. https://github.com/torvalds/linux/commit/67e9c74b8a873408c27ac9a8e4c1d1c8d72c93ff
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/cgroup-util.c2
-rw-r--r--src/basic/missing.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 56c1fcaab9..5124b5bf93 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -2129,7 +2129,7 @@ int cg_unified(void) {
if (statfs("/sys/fs/cgroup/", &fs) < 0)
return -errno;
- if (F_TYPE_EQUAL(fs.f_type, CGROUP_SUPER_MAGIC))
+ if (F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC))
unified_cache = true;
else if (F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC))
unified_cache = false;
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 034e334e66..66cd5921ad 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -437,6 +437,10 @@ struct btrfs_ioctl_quota_ctl_args {
#define CGROUP_SUPER_MAGIC 0x27e0eb
#endif
+#ifndef CGROUP2_SUPER_MAGIC
+#define CGROUP2_SUPER_MAGIC 0x63677270
+#endif
+
#ifndef TMPFS_MAGIC
#define TMPFS_MAGIC 0x01021994
#endif