From: Lennart Poettering Date: Wed, 29 Nov 2017 18:55:01 +0000 (+0100) Subject: core: accept MemorySwapMax= properties that are scaled, too X-Git-Tag: v236~94^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66a892ae3d5ebaa82298c40012b95534ba34cfb1;p=platform%2Fupstream%2Fsystemd.git core: accept MemorySwapMax= properties that are scaled, too Let's do what we already do for MemoryMax= and friends for MemorySwapMax= too. --- diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c index 6c999f6..690e3a3 100644 --- a/src/core/dbus-cgroup.c +++ b/src/core/dbus-cgroup.c @@ -1054,7 +1054,7 @@ int bus_cgroup_set_property( return 1; - } else if (STR_IN_SET(name, "MemoryLowScale", "MemoryHighScale", "MemoryMaxScale")) { + } else if (STR_IN_SET(name, "MemoryLowScale", "MemoryHighScale", "MemoryMaxScale", "MemorySwapMaxScale")) { uint32_t raw; uint64_t v; @@ -1077,7 +1077,9 @@ int bus_cgroup_set_property( c->memory_low = v; else if (streq(name, "MemoryHigh")) c->memory_high = v; - else + else if (streq(name, "MemorySwapMaxScale")) + c->memory_swap_max = v; + else /* MemoryMax */ c->memory_max = v; unit_invalidate_cgroup(u, CGROUP_MASK_MEMORY); @@ -1100,7 +1102,7 @@ int bus_cgroup_set_property( c->memory_limit = limit; unit_invalidate_cgroup(u, CGROUP_MASK_MEMORY); - if (limit == (uint64_t) -1) + if (limit == CGROUP_LIMIT_MAX) unit_write_setting(u, flags, name, "MemoryLimit=infinity"); else unit_write_settingf(u, flags, name, "MemoryLimit=%" PRIu64, limit);