This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new 28b3e8d37 [cgroups2] Moved subtree_control into the control namespace.
28b3e8d37 is described below
commit 28b3e8d378e8c9633db278a633d3b02906253a00
Author: Devin Leamy <[email protected]>
AuthorDate: Mon Mar 11 14:59:06 2024 +0000
[cgroups2] Moved subtree_control into the control namespace.
Non-trivial reading and writing of control files will be done inside of
`cgroups2::control::<control_name>::<function>` for top-level control
files (i.e. ones that start with "cgroups.*") and inside of
`cgroups2::<controller>::control::<control_name>::<function>` for
controllers (e.g. "cpu.*" of "memory.*" files).
This patch moves the `subtree_control` namespace to follow this structure.
---
src/linux/cgroups2.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/linux/cgroups2.cpp b/src/linux/cgroups2.cpp
index 5133e061c..0a71a296a 100644
--- a/src/linux/cgroups2.cpp
+++ b/src/linux/cgroups2.cpp
@@ -70,8 +70,6 @@ const std::string SUBTREE_CONTROLLERS =
"cgroup.subtree_control";
const std::string THREADS = "cgroup.threads";
const std::string TYPE = "cgroup.type";
-} // namespace control {
-
namespace subtree_control {
struct State
@@ -140,6 +138,8 @@ std::ostream& operator<<(std::ostream& stream, const State&
state)
} // namespace subtree_control {
+} // namespace control {
+
Try<string> read(const string& cgroup, const string& control)
{
@@ -269,7 +269,8 @@ Try<Nothing> enable(const string& cgroup, const
vector<string>& controllers)
return Error(contents.error());
}
- subtree_control::State control = subtree_control::State::parse(*contents);
+ using State = control::subtree_control::State;
+ State control = State::parse(*contents);
control.enable(controllers);
return cgroups2::write(
cgroup,