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)) {
if (ret != RESOURCED_ERROR_NONE)
return ret;
+ if (!resourced_restarted()) {
+ register_notifier(RESOURCED_NOTIFIER_BOOTING_DONE, swap_activate_handler);
+ } else {
+ _I("Assuming swap is already set up. To reconfigure, reboot the device.");
+ }
+
register_notifier(RESOURCED_NOTIFIER_SWAP_START, swap_start_handler);
register_notifier(RESOURCED_NOTIFIER_SWAP_ACTIVATE, swap_activate_handler);
- register_notifier(RESOURCED_NOTIFIER_BOOTING_DONE, swap_activate_handler);
register_notifier(RESOURCED_NOTIFIER_SWAP_COMPACT, swap_compact_handler);
register_notifier(RESOURCED_NOTIFIER_SWAP_UNSET_LIMIT, swap_cgroup_reset_limit);