From 50857801db8e3b6be491101439d769170548c06d Mon Sep 17 00:00:00 2001 From: glemco <32201227+glemco@users.noreply.github.com> Date: Tue, 12 May 2026 19:47:43 +0200 Subject: [PATCH] cgroups: Refactor cgroup_apply_cpuset() argument order Cgroups function have the name key first and then the value, cgroup_apply_cpuset() has the opposite. Swap the name and value (cpuset) arguments. --- src/core/cgroup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 52d73b3747e..48b7df0e00c 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1124,7 +1124,7 @@ static void cgroup_apply_cpu_quota(Unit *u, usec_t quota, usec_t period) { (void) set_attribute_and_warn(u, "cpu.max", buf); } -static void cgroup_apply_cpuset(Unit *u, const CPUSet *cpus, const char *name) { +static void cgroup_apply_cpuset(Unit *u, const char *name, const CPUSet *cpus) { _cleanup_free_ char *buf = NULL; buf = cpu_set_to_range_string(cpus); @@ -1513,8 +1513,8 @@ static void cgroup_context_apply( } if ((apply_mask & CGROUP_MASK_CPUSET) && !is_local_root) { - cgroup_apply_cpuset(u, cgroup_context_allowed_cpus(c, state), "cpuset.cpus"); - cgroup_apply_cpuset(u, cgroup_context_allowed_mems(c, state), "cpuset.mems"); + cgroup_apply_cpuset(u, "cpuset.cpus", cgroup_context_allowed_cpus(c, state)); + cgroup_apply_cpuset(u, "cpuset.mems", cgroup_context_allowed_mems(c, state)); if (c->cpuset_partition >= 0) cgroup_apply_cpuset_partition(u, "cpuset.cpus.partition", cpuset_partition_to_string(c->cpuset_partition)); -- 2.47.3