d_bus_register_signals(dbus_signals, ARRAY_SIZE(dbus_signals));
}
-static int config_parse_swap_types(
- const char *rvalue,
- void *data)
-{
- enum swap_type *type = data;
- char *word, *state;
- size_t l;
-
- if (is_empty(rvalue))
- return 0;
-
- *type = 0;
-
- FOREACH_WORD_SEPARATOR(word, l, rvalue, "+|", state) {
- if (strneq(word, "zram", l))
- *type |= SWAP_TYPE_ZRAM;
- else if (strneq(word, "file", l))
- *type |= SWAP_TYPE_FILE;
- else if (strneq(word, "zswap", l))
- *type |= SWAP_TYPE_ZSWAP;
- else
- return -EINVAL;
- }
-
- return 0;
-}
static void print_swap_conf(void)
{
goto free_swap_conf;
arg_swap_at_boot = swap_conf->boot_reclaim_enable;
- if (config_parse_swap_types(swap_conf->type, &arg_swap_type) < 0) {
- _E("[DEBUG] Failed to parse type of swap, so use default zram type");
- arg_swap_type = SWAP_TYPE_ZRAM;
- }
+ arg_swap_type = swap_conf->swap_type;
for(int cgroup = CGROUP_VIP; cgroup < CGROUP_END; cgroup++) {
if (swap_conf->swappiness[cgroup] >= 0 &&