summaryrefslogtreecommitdiff
path: root/src/basic
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/basic
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/basic')
-rw-r--r--src/basic/cgroup-util.c31
-rw-r--r--src/basic/cgroup-util.h2
2 files changed, 15 insertions, 18 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 3bdcf18074..30a16287e7 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -933,7 +933,7 @@ int cg_set_task_access(
if (r < 0)
return r;
- r = cg_unified(controller);
+ r = cg_unified_controller(controller);
if (r < 0)
return r;
if (r == 0) {
@@ -1008,7 +1008,7 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
} else
controller = SYSTEMD_CGROUP_CONTROLLER;
- unified = cg_unified(controller);
+ unified = cg_unified_controller(controller);
if (unified < 0)
return unified;
if (unified == 0) {
@@ -1083,7 +1083,7 @@ int cg_install_release_agent(const char *controller, const char *agent) {
assert(agent);
- r = cg_unified(controller);
+ r = cg_unified_controller(controller);
if (r < 0)
return r;
if (r > 0) /* doesn't apply to unified hierarchy */
@@ -1134,7 +1134,7 @@ int cg_uninstall_release_agent(const char *controller) {
_cleanup_free_ char *fs = NULL;
int r;
- r = cg_unified(controller);
+ r = cg_unified_controller(controller);
if (r < 0)
return r;
if (r > 0) /* Doesn't apply to unified hierarchy */
@@ -1190,7 +1190,7 @@ int cg_is_empty_recursive(const char *controller, const char *path) {
if (controller && (isempty(path) || path_equal(path, "/")))
return false;
- r = cg_unified(controller);
+ r = cg_unified_controller(controller);
if (r < 0)
return r;
if (r > 0) {
@@ -2342,17 +2342,14 @@ int cg_kernel_controllers(Set *controllers) {
static thread_local CGroupUnified unified_cache = CGROUP_UNIFIED_UNKNOWN;
-/* The hybrid mode was initially implemented in v232 and simply mounted
- * cgroup v2 on /sys/fs/cgroup/systemd. This unfortunately broke other
- * tools (such as docker) which expected the v1 "name=systemd" hierarchy
- * on /sys/fs/cgroup/systemd. From v233 and on, the hybrid mode mountnbs
- * v2 on /sys/fs/cgroup/unified and maintains "name=systemd" hierarchy
- * on /sys/fs/cgroup/systemd for compatibility with other tools.
+/* The hybrid mode was initially implemented in v232 and simply mounted cgroup v2 on /sys/fs/cgroup/systemd. This
+ * unfortunately broke other tools (such as docker) which expected the v1 "name=systemd" hierarchy on
+ * /sys/fs/cgroup/systemd. From v233 and on, the hybrid mode mountnbs v2 on /sys/fs/cgroup/unified and maintains
+ * "name=systemd" hierarchy on /sys/fs/cgroup/systemd for compatibility with other tools.
*
- * To keep live upgrade working, we detect and support v232 layout. When
- * v232 layout is detected, to keep cgroup v2 process management but
- * disable the compat dual layout, we return %true on
- * cg_unified(SYSTEMD_CGROUP_CONTROLLER) and %false on cg_hybrid_unified().
+ * To keep live upgrade working, we detect and support v232 layout. When v232 layout is detected, to keep cgroup v2
+ * process management but disable the compat dual layout, we return %true on
+ * cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER) and %false on cg_hybrid_unified().
*/
static thread_local bool unified_systemd_v232;
@@ -2395,7 +2392,7 @@ static int cg_update_unified(void) {
return 0;
}
-int cg_unified(const char *controller) {
+int cg_unified_controller(const char *controller) {
int r;
r = cg_update_unified();
@@ -2412,7 +2409,7 @@ int cg_unified(const char *controller) {
}
int cg_all_unified(void) {
- return cg_unified(NULL);
+ return cg_unified_controller(NULL);
}
int cg_hybrid_unified(void) {
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h
index fdc675ccd3..a522095d95 100644
--- a/src/basic/cgroup-util.h
+++ b/src/basic/cgroup-util.h
@@ -242,7 +242,7 @@ bool cg_ns_supported(void);
int cg_all_unified(void);
int cg_hybrid_unified(void);
-int cg_unified(const char *controller);
+int cg_unified_controller(const char *controller);
int cg_unified_flush(void);
bool cg_is_unified_wanted(void);