Add 'CpuSched' & Rearrange 'Swap' sections
[platform/core/system/resourced.git] / src / resource-optimizer / memory / swap / swap.c
index 54045c0..bc0bb69 100644 (file)
@@ -820,32 +820,6 @@ static void swap_dbus_init(void)
        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)
 {
@@ -876,10 +850,7 @@ static int swap_parse_config_file(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 &&