chiark / gitweb /
unit: rework resource management API
[elogind.git] / src / core / cgroup-attr.h
index 0f5b85489846c60c4403b1edd248027abd7683fa..0b542981e8df66d29527daf0424dd4157d978ca6 100644 (file)
 
 typedef struct CGroupAttribute CGroupAttribute;
 
-typedef int (*CGroupAttributeMapCallback)(const char *controller, const char*name, const char *value, char **ret);
-
 #include "unit.h"
 #include "cgroup.h"
+#include "cgroup-semantics.h"
 
 struct CGroupAttribute {
         char *controller;
@@ -35,7 +34,7 @@ struct CGroupAttribute {
 
         Unit *unit;
 
-        CGroupAttributeMapCallback map_callback;
+        const CGroupSemantics *semantics;
 
         LIST_FIELDS(CGroupAttribute, by_unit);
 };
@@ -43,7 +42,9 @@ struct CGroupAttribute {
 int cgroup_attribute_apply(CGroupAttribute *a, CGroupBonding *b);
 int cgroup_attribute_apply_list(CGroupAttribute *first, CGroupBonding *b);
 
+bool cgroup_attribute_matches(CGroupAttribute *a, const char *controller, const char *name);
 CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const char *controller, const char *name);
 
 void cgroup_attribute_free(CGroupAttribute *a);
 void cgroup_attribute_free_list(CGroupAttribute *first);
+void cgroup_attribute_free_some(CGroupAttribute *first, const char *controller, const char *name);