summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-01-12 09:56:17 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-01-12 09:56:17 -1000
commitb71e635feefc852405b14620a7fc58c4c80c0f73 (patch)
treedf4de4cf01fb87dd8c48f91937e58f331b439a0b /include
parent0f61b1860cc3f52aef9036d7235ed1f017632193 (diff)
parentef56578274d2b98423c8ef82bb450223f5811b59 (diff)
Merge tag 'cgroup-for-6.19-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fix from Tejun Heo: - Fix -Wflex-array-member-not-at-end warnings in cgroup_root * tag 'cgroup-for-6.19-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Eliminate cgrp_ancestor_storage in cgroup_root
Diffstat (limited to 'include')
-rw-r--r--include/linux/cgroup-defs.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index b760a3c470a5..f7cc60de0058 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -626,7 +626,13 @@ struct cgroup {
#endif
/* All ancestors including self */
- struct cgroup *ancestors[];
+ union {
+ DECLARE_FLEX_ARRAY(struct cgroup *, ancestors);
+ struct {
+ struct cgroup *_root_ancestor;
+ DECLARE_FLEX_ARRAY(struct cgroup *, _low_ancestors);
+ };
+ };
};
/*
@@ -647,16 +653,6 @@ struct cgroup_root {
struct list_head root_list;
struct rcu_head rcu; /* Must be near the top */
- /*
- * The root cgroup. The containing cgroup_root will be destroyed on its
- * release. cgrp->ancestors[0] will be used overflowing into the
- * following field. cgrp_ancestor_storage must immediately follow.
- */
- struct cgroup cgrp;
-
- /* must follow cgrp for cgrp->ancestors[0], see above */
- struct cgroup *cgrp_ancestor_storage;
-
/* Number of cgroups in the hierarchy, used only for /proc/cgroups */
atomic_t nr_cgrps;
@@ -668,6 +664,13 @@ struct cgroup_root {
/* The name for this hierarchy - may be empty */
char name[MAX_CGROUP_ROOT_NAMELEN];
+
+ /*
+ * The root cgroup. The containing cgroup_root will be destroyed on its
+ * release. This must be embedded last due to flexible array at the end
+ * of struct cgroup.
+ */
+ struct cgroup cgrp;
};
/*