Rearrange code and conf 23/273323/2
authorUnsung Lee <unsung.lee@samsung.com>
Mon, 4 Apr 2022 06:30:56 +0000 (15:30 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 4 Apr 2022 06:39:45 +0000 (15:39 +0900)
move CpuAffinity from limiter to optimizer
rename section in optimizer.conf

Change-Id: I77cad6d01a0a2d78b43b8e9eb31eb5df7c3a93d7
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
12 files changed:
CMakeLists.txt
conf/limiter.conf
conf/optimizer.conf
packaging/resourced.spec
src/CMakeLists.txt
src/common/config-parser.c
src/common/config-parser.h
src/common/swap-common.h
src/resource-optimizer/cpu/cpu-sched.c [moved from src/resource-limiter/cpu/cpu-sched.c with 100% similarity]
src/resource-optimizer/memory/swap/fileswap.c
src/resource-optimizer/memory/swap/swap.c
src/resource-optimizer/memory/swap/zswap.c

index 6232df7..974cc66 100644 (file)
@@ -55,6 +55,7 @@ SET(CGROUP_SOURCE_DIR                               ${COMMON_SOURCE_DIR}/cgroup)
 
 #resource-optimizer source folders
 SET(RESOURCE_OPTIMIZER_SOURCE_DIR                   ${SOURCE_DIR}/resource-optimizer)
+SET(CPU_RESOURCE_OPTIMIZER_SOURCE_DIR               ${RESOURCE_OPTIMIZER_SOURCE_DIR}/cpu)
 SET(MEMORY_RESOURCE_OPTIMIZER_SOURCE_DIR            ${RESOURCE_OPTIMIZER_SOURCE_DIR}/memory)
 SET(DEDUP_SOURCE_DIR                                ${RESOURCE_OPTIMIZER_SOURCE_DIR}/memory/dedup)
 SET(SWAP_SOURCE_DIR                                 ${RESOURCE_OPTIMIZER_SOURCE_DIR}/memory/swap)
index 35b9d7f..7fe7de7 100644 (file)
@@ -1,15 +1,15 @@
 [MemoryGroupLimit]
-VipGroupLimit=      100%
+VipGroupLimit=     100%
 HighGroupLimit=    100%
-MediumGroupLimit=90%
+MediumGroupLimit=  90%
 LowestGroupLimit=  70%
 
 [MemoryLevelThreshold]
-MediumLevel=  400MB
-LowLevel=         300MB
-CriticalLevel=    200MB
-OomLevel=       160MB
-OomPopup=no
+MediumLevel=       400MB
+LowLevel=          300MB
+CriticalLevel=     200MB
+OomLevel=          160MB
+OomPopup=          no
 
 [MemoryAppTypeLimit]
 ServicePerAppLimitAction=128MB,kill
@@ -18,6 +18,3 @@ GUIPerAppLimitAction=1024MB,kill
 
 [MemoryAppStatusLimit]
 BackgroundPerAppLimitAction=768MB,kill
-
-[CpuAffinity]
-ForegroundApps=1,2,4-6
index ff52344..ceaa3ad 100644 (file)
@@ -1,32 +1,35 @@
-[Swap]
-Enable=1
+[MemorySwap]
+SwapEnable=1
 ReclaimAtBoot=yes
-Type=zram+zswap
+SwapType=zram+zswap
 VipGroupSwappiness=0
 HighGroupSwappiness=5
 MediumGroupSwappiness=10
 LowestGroupSwappiness=20
 
-[Zram]
+[MemoryZram]
 CompAlgorithm=zstd
-Ratio=0.4
+ZramRatio=0.4
 
-[Zswap]
+[MemoryZswap]
 PoolRatio=40
 PoolType=z3fold
 
-[Dedup]
-Enable=1
+[MemoryDedup]
+DedupEnable=1
 DedupAtBoot=yes
 ScanOnLowmem=true
 
-[Ksm]
-Mode=oneshot
-#Mode=periodic
+[MemoryKsm]
+KsmMode=oneshot
+#KsmMode=periodic
 
 PagesToScan=100
 PagesToScanWithBoost=1000
 
-[Compaction]
-Enable=1
+[MemoryCompaction]
+CompactionEnable=1
 FragLevel=800
+
+[CpuAffinity]
+ForegroundApps=1,2,4-6
index dfb32a0..ef3d836 100644 (file)
@@ -24,7 +24,6 @@ Source0:    %{name}-%{version}.tar.gz
 %define cpu_module          ON
 %define memory_module       ON
 %define watchdog_module     ON
-%define compaction_module      ON
 
 %define confdir %{_sysconfdir}/resourced
 %define plugindir %{_libdir}/resourced/plugins
@@ -121,7 +120,6 @@ pushd build
         -DCMAKE_BUILD_TYPE=Release \
         -DCPU_MODULE=%{cpu_module} \
         -DMEMORY_MODULE=%{memory_module} \
-        -DCOMPACTION_MODULE=%{compaction_module} \
         -DPROC_WATCHDOG=%{watchdog_module} \
         -DRD_SYS_ETC=%{TZ_SYS_ETC} \
         -DRD_SYS_DATA=%{TZ_SYS_GLOBALUSER_DATA} \
@@ -213,6 +211,8 @@ fi
 %{plugindir}/libheart.so
 %{plugindir}/libswap.so
 %{plugindir}/libdedup.so
+%{plugindir}/libcompaction.so
+%{plugindir}/libcpu-sched.so
 %attr(700, root, root) %{TZ_SYS_ETC}/dump.d/module.d/dump_heart_data.sh
 
 %files bin
index b0189fb..cd13b49 100644 (file)
@@ -58,12 +58,12 @@ INCLUDE_DIRECTORIES(${RESOURCED_INCLUDEDIR}
 )
 
 #compaction module
-IF("${COMPACTION_MODULE}" STREQUAL "ON")
-  FILE(GLOB FILES "${COMPACTION_SOURCE_DIR}/*.c")
-  FOREACH(FILE ${FILES})
-      SET(SOURCES ${SOURCES} ${FILE})
-  ENDFOREACH()
-ENDIF()
+#IF("${COMPACTION_MODULE}" STREQUAL "ON")
+#  FILE(GLOB FILES "${COMPACTION_SOURCE_DIR}/*.c")
+#  FOREACH(FILE ${FILES})
+#      SET(SOURCES ${SOURCES} ${FILE})
+#  ENDFOREACH()
+#ENDIF()
 
 IF("${PROC_WATCHDOG}" STREQUAL "ON")
   SET(SOURCES ${SOURCES}
@@ -150,13 +150,25 @@ ADD_LIBRARY(swap MODULE
        ${SWAP_SOURCE_DIR}/zramswap.c)
 TARGET_LINK_LIBRARIES(swap resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
 INSTALL(TARGETS swap DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
-INSTALL(FILES ${CONF_DIR}/optimizer.conf DESTINATION ${RD_CONFIG_PATH})
 
 ADD_LIBRARY(dedup MODULE
        ${DEDUP_SOURCE_DIR}/dedup.c)
 TARGET_LINK_LIBRARIES(dedup resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
 INSTALL(TARGETS dedup DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
 
+ADD_LIBRARY(compaction MODULE
+       ${COMPACTION_SOURCE_DIR}/compaction.c)
+TARGET_LINK_LIBRARIES(compaction resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
+INSTALL(TARGETS compaction DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
+
+ADD_LIBRARY(cpu-sched MODULE
+       ${CPU_RESOURCE_OPTIMIZER_SOURCE_DIR}/cpu-sched.c)
+TARGET_LINK_LIBRARIES(cpu-sched resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS})
+INSTALL(TARGETS cpu-sched DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH})
+
+
+INSTALL(FILES ${CONF_DIR}/optimizer.conf DESTINATION ${RD_CONFIG_PATH})
+
 ADD_LIBRARY(heart MODULE
        ${RESOURCE_MONITOR_SOURCE_DIR}/heart.c
        ${ABNORMAL_MONITOR_SOURCE_DIR}/heart-abnormal.c
index 34e642e..f105ecc 100644 (file)
@@ -58,7 +58,7 @@ static int optimizer_config(struct parse_result *result, void *user_data)
        }
 
        if (!strncmp(result->section, SWAP_SECTION, strlen(SWAP_SECTION)+1)) {
-               if (!strncmp(result->name, ENABLE_CONF, strlen(ENABLE_CONF)+1)) {
+               if (!strncmp(result->name, SWAP_ENABLE_CONF, strlen(SWAP_ENABLE_CONF)+1)) {
                        if (!strncmp(result->value, "yes", 4) ||
                                !strncmp(result->value, "1", 2) ||
                                !strncmp(result->value, "ok", 3))
@@ -85,8 +85,8 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                                return RESOURCED_ERROR_FAIL;
                        }
                }
-               else if (!strncmp(result->name, TYPE_CONF,
-                                       strlen(TYPE_CONF)+1)) {
+               else if (!strncmp(result->name, SWAP_TYPE_CONF,
+                                       strlen(SWAP_TYPE_CONF)+1)) {
                        if (strlen(result->value) + 1 > sizeof(swap_conf->type)) {
                                _E("Size of swap_conf->type is not enough");
                                return RESOURCED_ERROR_OUT_OF_MEMORY;
@@ -123,7 +123,7 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                        strncpy(swap_conf->zram.algorithm, result->value,
                                        sizeof(swap_conf->zram.algorithm) - 1);
                }
-               else if (!strncmp(result->name, RATIO_CONF, strlen(RATIO_CONF)+1)) {
+               else if (!strncmp(result->name, ZRAM_RATIO_CONF, strlen(ZRAM_RATIO_CONF)+1)) {
                        swap_conf->zram.ratio = atof(result->value);
                }
                else {
@@ -132,18 +132,7 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                }
        }
        else if (!strncmp(result->section, ZSWAP_SECTION, strlen(ZSWAP_SECTION)+1)) {
-               if (!strncmp(result->name, CRYPT_TYPE_CONF, strlen(CRYPT_TYPE_CONF)+1)) {
-                       if (strlen(result->value) + 1 > sizeof(swap_conf->zswap.type)) {
-                               _E("Size of swap_conf->zswap.type is not enough");
-                               return RESOURCED_ERROR_OUT_OF_MEMORY;
-                       }
-                       strncpy(swap_conf->zswap.type, result->value,
-                                       sizeof(swap_conf->zswap.type) - 1);
-               }
-               else if (!strncmp(result->name, FILE_SIZE_CONF, strlen(FILE_SIZE_CONF)+1)) {
-                       swap_conf->zswap.filesize = atol(result->value);
-               }
-               else if (!strncmp(result->name, POOL_RATIO_CONF, strlen(POOL_RATIO_CONF)+1)) {
+               if (!strncmp(result->name, POOL_RATIO_CONF, strlen(POOL_RATIO_CONF)+1)) {
                        swap_conf->zswap.pool_ratio = atof(result->value);
                }
                else if (!strncmp(result->name, POOL_TYPE_CONF, strlen(POOL_TYPE_CONF)+1)) {
@@ -159,25 +148,8 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                                        result->name, result->value, result->section);
                }
        }
-       else if (!strncmp(result->section, FILE_SWAP_SECTION, strlen(FILE_SWAP_SECTION)+1)) {
-               if (!strncmp(result->name, CRYPT_TYPE_CONF, strlen(CRYPT_TYPE_CONF)+1)) {
-                       if (strlen(result->value) + 1 > sizeof(swap_conf->fileswap.type)) {
-                               _E("Size of swap_conf->fileswap.type is not enough");
-                               return RESOURCED_ERROR_OUT_OF_MEMORY;
-                       }
-                       strncpy(swap_conf->fileswap.type, result->value,
-                                       sizeof(swap_conf->fileswap.type) - 1);
-               }
-               else if (!strncmp(result->name, FILE_SIZE_CONF, strlen(FILE_SIZE_CONF)+1)) {
-                       swap_conf->fileswap.filesize = atol(result->value);
-               }
-               else {
-                       _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
-                                       result->name, result->value, result->section);
-               }
-       }
        else if (!strncmp(result->section, DEDUP_SECTION, strlen(DEDUP_SECTION)+1)) {
-               if (!strncmp(result->name, ENABLE_CONF, strlen(ENABLE_CONF)+1)) {
+               if (!strncmp(result->name, DEDUP_ENABLE_CONF, strlen(DEDUP_ENABLE_CONF)+1)) {
                        if (!strncmp(result->value, "yes", 4) ||
                                !strncmp(result->value, "1", 2) ||
                                !strncmp(result->value, "ok", 3))
@@ -224,7 +196,7 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                }
        }
        else if (!strncmp(result->section, KSM_SECTION, strlen(KSM_SECTION)+1)) {
-               if (!strncmp(result->name, MODE_CONF, strlen(MODE_CONF)+1)) {
+               if (!strncmp(result->name, KSM_MODE_CONF, strlen(KSM_MODE_CONF)+1)) {
                        if (strlen(result->value) + 1 > sizeof(dedup_conf->ksm.mode)) {
                                _E("Size of swap_conf->type is not enough");
                                return RESOURCED_ERROR_OUT_OF_MEMORY;
@@ -245,7 +217,7 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                }
        }
        else if (!strncmp(result->section, COMPACTION_SECTION, strlen(COMPACTION_SECTION)+1)) {
-               if (!strncmp(result->name, ENABLE_CONF, strlen(ENABLE_CONF)+1)) {
+               if (!strncmp(result->name, COMPACTION_ENABLE_CONF, strlen(COMPACTION_ENABLE_CONF)+1)) {
                        if (!strncmp(result->value, "yes", 4) ||
                                !strncmp(result->value, "1", 2) ||
                                !strncmp(result->value, "ok", 3) ||
@@ -268,6 +240,21 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                                        result->name, result->value, result->section);
                }
        }
+       else if (!strncmp(result->section, CPU_AFFINITY_SECTION,
+                               strlen(CPU_AFFINITY_SECTION)+1)) {
+               int error = RESOURCED_ERROR_NONE;
+
+               if (!strncmp(result->name, FOREGROUND_APPS,
+                                       strlen(FOREGROUND_APPS) + 1)) {
+                       error = set_cpucg_conf(result->name, result->value);
+               }
+               else {
+                       _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
+                                       result->name, result->value, result->section);
+               }
+
+               return error;
+       }
        else {
                _E("[DEBUG] Unknown section name (%s) and value (%s) on section (%s)",
                                result->name, result->value, result->section);
@@ -425,26 +412,11 @@ static int limiter_config(struct parse_result *result, void *user_data)
 
                return error;
        }
-       else if (!strncmp(result->section, CPU_AFFINITY_SECTION,
-                               strlen(CPU_AFFINITY_SECTION)+1)) {
-               int error = RESOURCED_ERROR_NONE;
-
-               if (!strncmp(result->name, FOREGROUND_APPS,
-                                       strlen(FOREGROUND_APPS) + 1)) {
-                       error = set_cpucg_conf(result->name, result->value);
-               }
-               else {
-                       _E("[DEBUG] Unknown configuration name (%s) and value (%s) on section (%s)",
-                                       result->name, result->value, result->section);
-               }
-
-               return error;
-       }
        else {
                _E("[DEBUG] Unknown section name (%s) and value (%s) on section (%s)",
                                result->name, result->value, result->section);
        }
-       
+
        return RESOURCED_ERROR_NONE;
 }
 
index fce99d6..bdbbf55 100644 (file)
@@ -42,62 +42,61 @@ extern "C" {
 #define MEMORY_LEVEL_THRESHOLD_SECTION         "MemoryLevelThreshold"
 #define MEMORY_APP_TYPE_LIMIT_SECTION          "MemoryAppTypeLimit"
 #define MEMORY_APP_STATUS_LIMIT_SECTION                "MemoryAppStatusLimit"
-#define CPU_AFFINITY_SECTION                           "CpuAffinity"
 
 /* optimizer.conf */
-#define SWAP_SECTION                                           "Swap"
-#define ZRAM_SECTION                                           "Zram"
-#define ZSWAP_SECTION                                          "Zswap"
-#define FILE_SWAP_SECTION                                      "FileSwap"
-#define DEDUP_SECTION                                          "Dedup"
-#define KSM_SECTION                                                    "Ksm"
-#define COMPACTION_SECTION                                     "Compaction"
+#define SWAP_SECTION                                           "MemorySwap"
+#define ZRAM_SECTION                                           "MemoryZram"
+#define ZSWAP_SECTION                                          "MemoryZswap"
+#define DEDUP_SECTION                                          "MemoryDedup"
+#define KSM_SECTION                                                    "MemoryKsm"
+#define COMPACTION_SECTION                                     "MemoryCompaction"
+#define CPU_AFFINITY_SECTION                           "CpuAffinity"
 
 /* configuration name */
 /* limiter.conf */
-#define SERVICE_NAME_CONF                      "Service"
-#define APP_NAME_CONF                          "App"
-#define CPU_CGROUP_NAME_CONF           "CpuGroup"
-#define MEM_CGROUP_NAME_CONF           "MemGroup"
-#define MEM_LIMIT_ACTION_NAME_CONF     "MemLimitAction"
-#define CPU_PRIORITY_NAME_CONF         "CpuPriority"
-#define ACTION_ON_FAILURE_NAME_CONF    "ActionOnFailure"
-#define        WATCHDOG_ACTION_NAME_CONF       "WatchdogAction"
-#define VIP_GROUP_LIMIT_CONF           "VipGroupLimit"
-#define HIGH_GROUP_LIMIT_CONF          "HighGroupLimit"
-#define MEDIUM_GROUP_LIMIT_CONF                "MediumGroupLimit"
-#define LOWEST_GROUP_LIMIT_CONF                "LowestGroupLimit"
-#define MEDIUM_LEVEL_CONF                      "MediumLevel"
-#define LOW_LEVEL_CONF                         "LowLevel"
-#define CRITICAL_LEVEL_CONF                    "CriticalLevel"
-#define OOM_LEVEL_CONF                         "OomLevel"
-#define OOM_POPUP_CONF                         "OomPopup"
+#define SERVICE_NAME_CONF                              "Service"
+#define APP_NAME_CONF                                  "App"
+#define CPU_CGROUP_NAME_CONF                   "CpuGroup"
+#define MEM_CGROUP_NAME_CONF                   "MemGroup"
+#define MEM_LIMIT_ACTION_NAME_CONF             "MemLimitAction"
+#define CPU_PRIORITY_NAME_CONF                 "CpuPriority"
+#define ACTION_ON_FAILURE_NAME_CONF            "ActionOnFailure"
+#define        WATCHDOG_ACTION_NAME_CONF               "WatchdogAction"
+#define VIP_GROUP_LIMIT_CONF                   "VipGroupLimit"
+#define HIGH_GROUP_LIMIT_CONF                  "HighGroupLimit"
+#define MEDIUM_GROUP_LIMIT_CONF                        "MediumGroupLimit"
+#define LOWEST_GROUP_LIMIT_CONF                        "LowestGroupLimit"
+#define MEDIUM_LEVEL_CONF                              "MediumLevel"
+#define LOW_LEVEL_CONF                                 "LowLevel"
+#define CRITICAL_LEVEL_CONF                            "CriticalLevel"
+#define OOM_LEVEL_CONF                                 "OomLevel"
+#define OOM_POPUP_CONF                                 "OomPopup"
 #define SERVICE_PER_APP_LIMIT_ACTION   "ServicePerAppLimitAction"
 #define WIDGET_PER_APP_LIMIT_ACTION            "WidgetPerAppLimitAction"
 #define GUI_PER_APP_LIMIT_ACTION               "GUIPerAppLimitAction"
 #define BACKGROUND_PER_APP_LIMIT_ACTION        "BackgroundPerAppLimitAction"
-#define FOREGROUND_APPS                                        "ForegroundApps"
 
-/* optimizer.cnof */
-#define        ENABLE_CONF                                             "Enable"
+/* optimizer.conf */
+#define        SWAP_ENABLE_CONF                                "SwapEnable"
 #define RECLAIM_AT_BOOT_CONF                   "ReclaimAtBoot"
-#define TYPE_CONF                                              "Type"
+#define SWAP_TYPE_CONF                                 "SwapType"
 #define VIP_GROUP_SWAPPINESS_CONF              "VipGroupSwappiness"
 #define HIGH_GROUP_SWAPPINESS_CONF             "HighGroupSwappiness"
 #define MEDIUM_GROUP_SWAPPINESS_CONF   "MediumGroupSwappiness"
 #define LOWEST_GROUP_SWAPPINESS_CONF   "LowestGroupSwappiness"
 #define COMP_ALGORITHM_CONF                            "CompAlgorithm"
-#define RATIO_CONF                                             "Ratio"
-#define CRYPT_TYPE_CONF                                        "CryptType"
-#define FILE_SIZE_CONF                                 "FileSize"
+#define ZRAM_RATIO_CONF                                        "ZramRatio"
 #define POOL_RATIO_CONF                                        "PoolRatio"
 #define POOL_TYPE_CONF                                 "PoolType"
+#define        DEDUP_ENABLE_CONF                               "DedupEnable"
 #define DEDUP_AT_BOOT_CONF                             "DedupAtBoot"
 #define        SCAN_ON_LOWMEM_CONF                             "ScanOnLowmem"
-#define MODE_CONF                                              "Mode"
+#define KSM_MODE_CONF                                  "KsmMode"
 #define        PAGES_TO_SCAN_CONF                              "PagesToScan"
 #define PAGES_TO_SCAN_WITH_BOOST_CONF  "PagesToScanWithBoost"
+#define        COMPACTION_ENABLE_CONF                  "CompactionEnable"
 #define FRAG_LEVEL_CONF                                        "FragLevel"
+#define FOREGROUND_APPS                                        "ForegroundApps"
 
 /* configuration value */
 #define CGROUP_VIP_VALUE_CONF          "vip"
index 918b329..f4d2c3e 100644 (file)
@@ -97,17 +97,10 @@ struct zram_conf {
 };
 
 struct zswap_conf {
-       char type[MAX_TYPE_LENGTH - 1];
-       long filesize;
        float pool_ratio;
        char pool_type[MAX_TYPE_LENGTH -1];
 };
 
-struct fileswap_conf {
-       char type[MAX_TYPE_LENGTH - 1];
-       long filesize;
-};
-
 struct swap_conf {
        bool enable;
        bool boot_reclaim_enable;
@@ -115,7 +108,6 @@ struct swap_conf {
        int swappiness[CGROUP_END];
        struct zram_conf zram;
        struct zswap_conf zswap;
-       struct fileswap_conf fileswap;
 };
 
 struct swap_conf *get_swap_conf(void);
index 1825137..58b09f9 100644 (file)
@@ -109,18 +109,6 @@ static int swap_file_init(void *data)
 
 static int swap_file_conf(void *data)
 {
-       struct fileswap_conf *fileswap_conf = (struct fileswap_conf *)data;
-       if (!fileswap_conf) {
-               _E("Fileswap configuration should not be NULL");
-               return RESOURCED_ERROR_FAIL;
-       }
-
-       if (check_valid_compressor(fileswap_conf->type) == RESOURCED_ERROR_NONE)
-               strncpy(file_control.crypt_type, fileswap_conf->type, MAX_TYPE_LENGTH-1);
-
-       if (fileswap_conf->filesize > 0)
-               file_control.swap_file_size = fileswap_conf->filesize;
-
        _I("[DEBUG] fileswap crypt type = %s", file_control.crypt_type);
        _I("[DEBUG] fileswap file size = %ld", file_control.swap_file_size);
 
index ebf8160..54045c0 100644 (file)
@@ -899,7 +899,7 @@ static int swap_parse_config_file(void)
                else if (!strncmp(swaps->name, "ZSWAP", 6))
                        r = swaps->conf(&swap_conf->zswap);
                else if (!strncmp(swaps->name, "FILESWAP", 9))
-                       r = swaps->conf(&swap_conf->fileswap);
+                       r = swaps->conf(NULL);
        }
 
 free_swap_conf:
index 6af8068..00653b6 100644 (file)
@@ -130,12 +130,6 @@ static int swap_zswap_conf(void *data)
                return RESOURCED_ERROR_FAIL;
        }
 
-       if (check_valid_compressor(zswap_conf->type) == RESOURCED_ERROR_NONE)
-               strncpy(zswap_control.crypt_type, zswap_conf->type, MAX_TYPE_LENGTH-1);
-
-       if (zswap_conf->filesize > 0)
-               zswap_control.zswap_file_size = zswap_conf->filesize;
-
        if (zswap_conf->pool_ratio > 0.0)
                zswap_control.zpool_ratio = zswap_conf->pool_ratio;