2022-11-21 20:18:42

by Alexey Romanov

[permalink] [raw]
Subject: [RFC PATCH v1 4/4] zram: recompression: add ZRAM_MERGED check

It is not possible to recompress merged pages in the current
implementation. Although, in the future it is possible to add
support for recompression of merged pages.

Signed-off-by: Alexey Romanov <[email protected]>
---
drivers/block/zram/zram_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 7a267b37e5db..07661283ea15 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -2211,7 +2211,8 @@ static ssize_t recompress_store(struct device *dev,
if (zram_test_flag(zram, index, ZRAM_WB) ||
zram_test_flag(zram, index, ZRAM_UNDER_WB) ||
zram_test_flag(zram, index, ZRAM_SAME) ||
- zram_test_flag(zram, index, ZRAM_INCOMPRESSIBLE))
+ zram_test_flag(zram, index, ZRAM_INCOMPRESSIBLE) ||
+ zram_test_flag(zram, index, ZRAM_MERGED))
goto next;

err = zram_recompress(zram, index, page, threshold,
--
2.25.1