]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cpu-set-util: rename cpu_set_add_all() and cpu_mask_add_all()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 20 Jun 2025 22:02:48 +0000 (07:02 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Jun 2025 15:20:20 +0000 (00:20 +0900)
This renames
- cpu_set_add_all() -> cpu_set_add_set(),
- cpu_mask_add_all() -> cpu_set_add_all().

No functional change, just refactoring.

src/core/dbus-execute.c
src/shared/cpu-set-util.c
src/shared/cpu-set-util.h
src/shared/numa-util.c
src/udev/net/link-config.c

index c0915f501a1d26acd6e7d381856b04d55f259d8d..e277849948a5052b6ad81ba4801cfad81f4e15b1 100644 (file)
@@ -2901,9 +2901,9 @@ int bus_exec_context_set_transient_property(
                                         return -ENOMEM;
 
                                 /* We forego any optimizations here, and always create the structure using
-                                 * cpu_set_add_all(), because we don't want to care if the existing size we
+                                 * cpu_set_add_set(), because we don't want to care if the existing size we
                                  * got over dbus is appropriate. */
-                                r = cpu_set_add_all(affinity ? &c->cpu_set : &c->numa_policy.nodes, &set);
+                                r = cpu_set_add_set(affinity ? &c->cpu_set : &c->numa_policy.nodes, &set);
                                 if (r < 0)
                                         return r;
 
index b7be99bbb605b822d3cbcd5fe9e2748aa1f74d36..8bad1e8741aec4fdc83a170a34fed1c80f7e92e5 100644 (file)
@@ -159,7 +159,7 @@ int cpu_set_add(CPUSet *c, size_t i) {
         return 0;
 }
 
-int cpu_set_add_all(CPUSet *c, const CPUSet *src) {
+int cpu_set_add_set(CPUSet *c, const CPUSet *src) {
         int r;
 
         assert(c);
@@ -196,7 +196,7 @@ static int cpu_set_add_range(CPUSet *c, size_t start, size_t end) {
         return 0;
 }
 
-int cpu_mask_add_all(CPUSet *c) {
+int cpu_set_add_all(CPUSet *c) {
         assert(c);
 
         long m = sysconf(_SC_NPROCESSORS_ONLN);
@@ -292,7 +292,7 @@ int parse_cpu_set_extend(
                 return 1;
         }
 
-        return cpu_set_add_all(old, &cpuset);
+        return cpu_set_add_set(old, &cpuset);
 }
 
 int cpus_in_affinity_mask(void) {
index 610a2b2c7763413d5ceb5b57db2bd24c15605da4..50535fdc2f316f5680cc79c0caec686cbda8d908 100644 (file)
@@ -23,8 +23,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(CPUSet*, cpu_set_free);
 
 int cpu_set_realloc(CPUSet *c, size_t n);
 int cpu_set_add(CPUSet *c, size_t i);
-int cpu_set_add_all(CPUSet *c, const CPUSet *src);
-int cpu_mask_add_all(CPUSet *c);
+int cpu_set_add_set(CPUSet *c, const CPUSet *src);
+int cpu_set_add_all(CPUSet *c);
 
 char* cpu_set_to_string(const CPUSet *c);
 char* cpu_set_to_range_string(const CPUSet *c);
index 88f02bc5595be6d09488175d753cc40bc15508df..c06ad985d8c1446984a713e866cdcb2d67638297 100644 (file)
@@ -116,7 +116,7 @@ int numa_to_cpu_set(const NUMAPolicy *policy, CPUSet *ret) {
                 if (r < 0)
                         return r;
 
-                r = cpu_set_add_all(&s, &part);
+                r = cpu_set_add_set(&s, &part);
                 if (r < 0)
                         return r;
         }
index 831575666d11c91d92aa745959d384754c39b5b9..b10e48a4ae7823eefd66a5b681e1b30c9367b1cf 100644 (file)
@@ -1396,7 +1396,7 @@ int config_parse_rps_cpu_mask(
                 cpu_set_reset(mask);
 
         else if (streq(rvalue, "all")) {
-                r = cpu_mask_add_all(mask);
+                r = cpu_set_add_all(mask);
                 if (r < 0) {
                         log_syntax(unit, LOG_WARNING, filename, line, r,
                                    "Failed to create CPU affinity mask representing \"all\" cpus, ignoring: %m");