From: glemco <32201227+glemco@users.noreply.github.com> Date: Tue, 12 May 2026 17:47:43 +0000 (+0200) Subject: cgroups: Refactor cgroup_apply_cpuset() argument order X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F42013%2Fhead;p=thirdparty%2Fsystemd.git 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. --- 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));