summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-24 18:00:04 +0100
committerLennart Poettering <lennart@poettering.net>2017-02-24 18:00:04 +0100
commitc22800e40e1709e4794308114543f6d6d419e4ae (patch)
treeba30e777016191d2e2bd48ea59f41345293e5c29 /src/core
parentb4cccbc13ad6f98bd8e816ce5fffb99f5be74c8c (diff)
cgroup: rename cg_unified() → cg_unified_controller()
cg_unified() is a bit generic a name, let's make clear that it checks whether a specified controller is in unified mode.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cgroup.c8
-rw-r--r--src/core/manager.c2
-rw-r--r--src/core/scope.c2
-rw-r--r--src/core/service.c2
-rw-r--r--src/core/unit.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index ea6e106447..774b832a63 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -1259,7 +1259,7 @@ int unit_watch_cgroup(Unit *u) {
return 0;
/* Only applies to the unified hierarchy */
- r = cg_unified(SYSTEMD_CGROUP_CONTROLLER);
+ r = cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER);
if (r < 0)
return log_error_errno(r, "Failed to determine whether the name=systemd hierarchy is unified: %m");
if (r == 0)
@@ -1684,7 +1684,7 @@ int unit_watch_all_pids(Unit *u) {
if (!u->cgroup_path)
return -ENOENT;
- r = cg_unified(SYSTEMD_CGROUP_CONTROLLER);
+ r = cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER);
if (r < 0)
return r;
if (r > 0) /* On unified we can use proper notifications */
@@ -1807,7 +1807,7 @@ int manager_setup_cgroup(Manager *m) {
if (r > 0)
log_debug("Unified cgroup hierarchy is located at %s.", path);
else {
- r = cg_unified(SYSTEMD_CGROUP_CONTROLLER);
+ r = cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER);
if (r < 0)
return log_error_errno(r, "Failed to determine whether systemd's own controller is in unified mode: %m");
if (r > 0)
@@ -1820,7 +1820,7 @@ int manager_setup_cgroup(Manager *m) {
const char *scope_path;
/* 3. Install agent */
- if (cg_unified(SYSTEMD_CGROUP_CONTROLLER) > 0) {
+ if (cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER) > 0) {
/* In the unified hierarchy we can get
* cgroup empty notifications via inotify. */
diff --git a/src/core/manager.c b/src/core/manager.c
index 7a09ac1d6e..cff38e28de 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -776,7 +776,7 @@ static int manager_setup_cgroups_agent(Manager *m) {
if (!MANAGER_IS_SYSTEM(m))
return 0;
- r = cg_unified(SYSTEMD_CGROUP_CONTROLLER);
+ r = cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER);
if (r < 0)
return log_error_errno(r, "Failed to determine whether unified cgroups hierarchy is used: %m");
if (r > 0) /* We don't need this anymore on the unified hierarchy */
diff --git a/src/core/scope.c b/src/core/scope.c
index af93d577dd..a1d5c1cfd5 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -475,7 +475,7 @@ static void scope_sigchld_event(Unit *u, pid_t pid, int code, int status) {
/* If the PID set is empty now, then let's finish this off
(On unified we use proper notifications) */
- if (cg_unified(SYSTEMD_CGROUP_CONTROLLER) == 0 && set_isempty(u->pids))
+ if (cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER) == 0 && set_isempty(u->pids))
scope_notify_cgroup_empty_event(u);
}
diff --git a/src/core/service.c b/src/core/service.c
index 3872ea1d9b..5581ec8b06 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2938,7 +2938,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
/* If the PID set is empty now, then let's finish this off
(On unified we use proper notifications) */
- if (cg_unified(SYSTEMD_CGROUP_CONTROLLER) == 0 && set_isempty(u->pids))
+ if (cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER) == 0 && set_isempty(u->pids))
service_notify_cgroup_empty_event(u);
}
diff --git a/src/core/unit.c b/src/core/unit.c
index 91f49aa210..81a92b8841 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3897,7 +3897,7 @@ int unit_kill_context(
* there we get proper events. Hence rely on
* them.*/
- if (cg_unified(SYSTEMD_CGROUP_CONTROLLER) > 0 ||
+ if (cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER) > 0 ||
(detect_container() == 0 && !unit_cgroup_delegate(u)))
wait_for_exit = true;