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.
This commit is contained in:
Lennart Poettering
2016-06-14 20:01:45 +02:00
parent 799ec13412
commit d8cf2ac79b
6 changed files with 68 additions and 4 deletions
+1
View File
@@ -184,6 +184,7 @@ int namespace_open(pid_t pid, int *pidns_fd, int *mntns_fd, int *netns_fd, int *
int namespace_enter(int pidns_fd, int mntns_fd, int netns_fd, int userns_fd, int root_fd);
uint64_t physical_memory(void);
uint64_t physical_memory_scale(uint64_t v, uint64_t max);
int update_reboot_parameter_and_warn(const char *param);