diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-02-27 18:50:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-02-27 18:50:41 +0100 |
commit | 26d04f86a36595e3565c74d67863e076c3e3c773 (patch) | |
tree | 374ba1bdf5dfc95a9c05df1232ffc44d8bd98397 /src/core/cgroup-attr.h | |
parent | 416389f7ae262ae7a0848302e7a6516597f9fad1 (diff) |
unit: rework resource management API
This introduces a new static list of known attributes and their special
semantics. This means that cgroup attribute values can now be
automatically translated from user to kernel notation for command line
set settings, too.
This also adds proper support for multi-line attributes.
Diffstat (limited to 'src/core/cgroup-attr.h')
-rw-r--r-- | src/core/cgroup-attr.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/cgroup-attr.h b/src/core/cgroup-attr.h index 0f5b854898..0b542981e8 100644 --- a/src/core/cgroup-attr.h +++ b/src/core/cgroup-attr.h @@ -23,10 +23,9 @@ 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); |