To avoid reconfiguration and possible loss of swapped data, or setting
up multiple swap devices, we assume that swap is configured after boot
and survive resourced restarts.
The side effect is that for change of swap configuration a reboot is
needed.
Change-Id: I874be98ed2a491ce932202987ae99113aa2519c0
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
#include "proc-main.h"
#include "util.h"
#include "losetup.h"
+#include "init.h"
#define MEMCG_PATH "/sys/fs/cgroup/memory/"
#define MEMCG_SIZE_LIMIT "memory.limit_in_bytes"
if (!arg_swap_enable)
return -ENODEV;
+ if (resourced_restarted()) {
+ _I("Assuming swap is already set up. To reconfigure, reboot the device.");
+ return 0;
+ }
+
gslist_for_each_safe(swap_module, iter, next, swaps) {
swaps = (struct swap_module_ops *)iter->data;
if (!CHECK_BIT(arg_swap_type, swaps->type)) {