Merge tag 'thunderbolt-for-v5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / mm / zswap.c
index 55094e6..fbb7829 100644 (file)
@@ -77,8 +77,8 @@ static bool zswap_pool_reached_full;
 
 #define ZSWAP_PARAM_UNSET ""
 
-/* Enable/disable zswap (disabled by default) */
-static bool zswap_enabled;
+/* Enable/disable zswap */
+static bool zswap_enabled = IS_ENABLED(CONFIG_ZSWAP_DEFAULT_ON);
 static int zswap_enabled_param_set(const char *,
                                   const struct kernel_param *);
 static struct kernel_param_ops zswap_enabled_param_ops = {
@@ -88,8 +88,7 @@ static struct kernel_param_ops zswap_enabled_param_ops = {
 module_param_cb(enabled, &zswap_enabled_param_ops, &zswap_enabled, 0644);
 
 /* Crypto compressor to use */
-#define ZSWAP_COMPRESSOR_DEFAULT "lzo"
-static char *zswap_compressor = ZSWAP_COMPRESSOR_DEFAULT;
+static char *zswap_compressor = CONFIG_ZSWAP_COMPRESSOR_DEFAULT;
 static int zswap_compressor_param_set(const char *,
                                      const struct kernel_param *);
 static struct kernel_param_ops zswap_compressor_param_ops = {
@@ -101,8 +100,7 @@ module_param_cb(compressor, &zswap_compressor_param_ops,
                &zswap_compressor, 0644);
 
 /* Compressed storage zpool to use */
-#define ZSWAP_ZPOOL_DEFAULT "zbud"
-static char *zswap_zpool_type = ZSWAP_ZPOOL_DEFAULT;
+static char *zswap_zpool_type = CONFIG_ZSWAP_ZPOOL_DEFAULT;
 static int zswap_zpool_param_set(const char *, const struct kernel_param *);
 static struct kernel_param_ops zswap_zpool_param_ops = {
        .set =          zswap_zpool_param_set,
@@ -599,11 +597,12 @@ static __init struct zswap_pool *__zswap_pool_create_fallback(void)
        bool has_comp, has_zpool;
 
        has_comp = crypto_has_comp(zswap_compressor, 0, 0);
-       if (!has_comp && strcmp(zswap_compressor, ZSWAP_COMPRESSOR_DEFAULT)) {
+       if (!has_comp && strcmp(zswap_compressor,
+                               CONFIG_ZSWAP_COMPRESSOR_DEFAULT)) {
                pr_err("compressor %s not available, using default %s\n",
-                      zswap_compressor, ZSWAP_COMPRESSOR_DEFAULT);
+                      zswap_compressor, CONFIG_ZSWAP_COMPRESSOR_DEFAULT);
                param_free_charp(&zswap_compressor);
-               zswap_compressor = ZSWAP_COMPRESSOR_DEFAULT;
+               zswap_compressor = CONFIG_ZSWAP_COMPRESSOR_DEFAULT;
                has_comp = crypto_has_comp(zswap_compressor, 0, 0);
        }
        if (!has_comp) {
@@ -614,11 +613,12 @@ static __init struct zswap_pool *__zswap_pool_create_fallback(void)
        }
 
        has_zpool = zpool_has_pool(zswap_zpool_type);
-       if (!has_zpool && strcmp(zswap_zpool_type, ZSWAP_ZPOOL_DEFAULT)) {
+       if (!has_zpool && strcmp(zswap_zpool_type,
+                                CONFIG_ZSWAP_ZPOOL_DEFAULT)) {
                pr_err("zpool %s not available, using default %s\n",
-                      zswap_zpool_type, ZSWAP_ZPOOL_DEFAULT);
+                      zswap_zpool_type, CONFIG_ZSWAP_ZPOOL_DEFAULT);
                param_free_charp(&zswap_zpool_type);
-               zswap_zpool_type = ZSWAP_ZPOOL_DEFAULT;
+               zswap_zpool_type = CONFIG_ZSWAP_ZPOOL_DEFAULT;
                has_zpool = zpool_has_pool(zswap_zpool_type);
        }
        if (!has_zpool) {