chiark / gitweb /
cgroup: make cgroup controller name a constant
[elogind.git] / src / cgroup.h
index 67c7cc35019497c634bbc120fbe45dbf86bec142..a7ca8abb063bcb6e35fd7081369babf48aa90f08 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <libcgroup.h>
-
 typedef struct CGroupBonding CGroupBonding;
 
 #include "unit.h"
 
+#define SYSTEMD_CGROUP_CONTROLLER "name=systemd"
+
 /* Binds a cgroup to a name */
 struct CGroupBonding {
         char *controller;
@@ -35,8 +35,6 @@ struct CGroupBonding {
 
         Unit *unit;
 
-        struct cgroup *cgroup;
-
         /* For the Unit::cgroup_bondings list */
         LIST_FIELDS(CGroupBonding, by_unit);
 
@@ -48,6 +46,9 @@ struct CGroupBonding {
 
         /* When our tasks are the only ones in this group */
         bool only_us:1;
+
+        /* This cgroup is realized */
+        bool realized:1;
 };
 
 int cgroup_bonding_realize(CGroupBonding *b);
@@ -62,6 +63,9 @@ int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid);
 int cgroup_bonding_kill(CGroupBonding *b, int sig);
 int cgroup_bonding_kill_list(CGroupBonding *first, int sig);
 
+void cgroup_bonding_trim(CGroupBonding *first, bool delete_root);
+void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root);
+
 int cgroup_bonding_is_empty(CGroupBonding *b);
 int cgroup_bonding_is_empty_list(CGroupBonding *first);
 
@@ -72,7 +76,7 @@ char *cgroup_bonding_to_string(CGroupBonding *b);
 #include "manager.h"
 
 int manager_setup_cgroup(Manager *m);
-int manager_shutdown_cgroup(Manager *m, bool delete);
+int manager_shutdown_cgroup(Manager *m);
 
 int cgroup_notify_empty(Manager *m, const char *group);