summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-08 20:45:32 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-14 20:01:45 +0200
commitd8cf2ac79b524d7784bccb428295ebc9c5e8548c (patch)
tree43a03ab780ccc0b130dc57322c816f99e3f09754 /src/core
parent799ec13412e2f6649fd69ce4f1ca1674a40039b0 (diff)
util: introduce physical_memory_scale() to unify how we scale by physical memory
The various bits of code did the scaling all different, let's unify this, given that the code is not trivial.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/load-fragment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 05852cc7e3..58d7275a96 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2821,7 +2821,7 @@ int config_parse_memory_limit(
return 0;
}
} else
- bytes = (((physical_memory() / page_size()) * (uint64_t) r) / 100) * page_size();
+ bytes = physical_memory_scale(r, 100U);
if (bytes < 1) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Memory limit '%s' too small. Ignoring.", rvalue);