summaryrefslogtreecommitdiff
path: root/src/core/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@fb.com>2016-05-18 13:50:56 -0700
committerTejun Heo <tj@kernel.org>2016-05-18 13:50:56 -0700
commit9be572497df8dd0a076c3a2c9142e25b1106aa60 (patch)
tree3e40c07f8014eef9d57554b52f85841f0f674730 /src/core/cgroup.h
parent4e080f502a5cd6e538a03472070aae8a730c15e9 (diff)
downloadsystemd-9be572497df8dd0a076c3a2c9142e25b1106aa60.tar.gz
core: introduce CGroupIOLimitType enums
Currently, there are two cgroup IO limits, bandwidth max for read and write, and they are hard-coded in various places. This is fine for two limits but IO is expected to grow more limits - low, high and max limits for bandwidth and IOPS - and hard-coding each limit won't make sense. This patch replaces hard-coded limits with an array indexed by CGroupIOLimitType and accompanying string and default value tables so that new limits can be added trivially.
Diffstat (limited to 'src/core/cgroup.h')
-rw-r--r--src/core/cgroup.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index a533923072..1907461f7e 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -23,6 +23,7 @@
#include "list.h"
#include "time-util.h"
+#include "cgroup-util.h"
typedef struct CGroupContext CGroupContext;
typedef struct CGroupDeviceAllow CGroupDeviceAllow;
@@ -64,8 +65,7 @@ struct CGroupIODeviceWeight {
struct CGroupIODeviceLimit {
LIST_FIELDS(CGroupIODeviceLimit, device_limits);
char *path;
- uint64_t rbps_max;
- uint64_t wbps_max;
+ uint64_t limits[_CGROUP_IO_LIMIT_TYPE_MAX];
};
struct CGroupBlockIODeviceWeight {