]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroups: Refactor cgroup_apply_cpuset() argument order 42013/head
authorglemco <32201227+glemco@users.noreply.github.com>
Tue, 12 May 2026 17:47:43 +0000 (19:47 +0200)
committerglemco <32201227+glemco@users.noreply.github.com>
Thu, 14 May 2026 06:55:44 +0000 (08:55 +0200)
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

index 52d73b3747edb2b809757c4f1ed78e8214a4ea22..48b7df0e00c08e8767b2c793fc30ed8f34edc771 100644 (file)
@@ -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));