summaryrefslogtreecommitdiff
path: root/src/basic/cgroup-util.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@fb.com>2016-11-21 14:45:53 -0500
committerSven Eden <yamakuzure@gmx.net>2017-07-17 17:58:35 +0200
commit0f58036abf34e92313105839658420e95acfdd7e (patch)
tree68127ad53f20fc4eddd50c926c908b525878b9ac /src/basic/cgroup-util.h
parentf000ad56fe2346cc8391eeb684681e707711b3ce (diff)
core: simplify cg_[all_]unified()
cg_[all_]unified() test whether a specific controller or all controllers are on the unified hierarchy. While what's being asked is a simple binary question, the callers must assume that the functions may fail any time, which unnecessarily complicates their usages. This complication is unnecessary. Internally, the test result is cached anyway and there are only a few places where the test actually needs to be performed. This patch simplifies cg_[all_]unified(). * cg_[all_]unified() are updated to return bool. If the result can't be decided, assertion failure is triggered. Error handlings from their callers are dropped. * cg_unified_flush() is updated to calculate the new result synchrnously and return whether it succeeded or not. Places which need to flush the test result are updated to test for failure. This ensures that all the following cg_[all_]unified() tests succeed. * Places which expected possible cg_[all_]unified() failures are updated to call and test cg_unified_flush() before calling cg_[all_]unified(). This includes functions used while setting up mounts during boot and manager_setup_cgroup().
Diffstat (limited to 'src/basic/cgroup-util.h')
-rw-r--r--src/basic/cgroup-util.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h
index f78f2355b..5fbea23d0 100644
--- a/src/basic/cgroup-util.h
+++ b/src/basic/cgroup-util.h
@@ -255,7 +255,6 @@ bool cg_ns_supported(void);
#if 0 /// UNNEEDED by elogind
bool cg_all_unified(void);
-bool cg_hybrid_unified(void);
bool cg_unified(const char *controller);
int cg_unified_flush(void);