linux-loongson/drivers/block/zram
Sergey Senozhatsky e74a1c6a8e zram: pass buffer offset to zcomp_available_show()
In most cases zcomp_available_show() is the only emitting
function that is called from sysfs read() handler, so it
assumes that there is a whole PAGE_SIZE buffer to work with.
There is an exception, however: recomp_algorithm_show().

In recomp_algorithm_show() we prepend the buffer with
priority number before we pass it to zcomp_available_show(),
so it cannot assume PAGE_SIZE anymore and must take
recomp_algorithm_show() modifications into consideration.
Therefore we need to pass buffer offset to zcomp_available_show().

Also convert it to use sysfs_emit_at(), to stay aligned
with the rest of zram's sysfs read() handlers.

On practice we are never even close to using the whole PAGE_SIZE
buffer, so that's not a critical bug, but still.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Link: https://lore.kernel.org/r/20250627071840.1394242-1-senozhatsky@chromium.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-07-03 19:56:51 -06:00
..
backend_842.c zram: move immutable comp params away from per-CPU context 2024-09-09 16:39:10 -07:00
backend_842.h zram: add 842 compression backend support 2024-09-09 16:39:08 -07:00
backend_deflate.c zram: support deflate-specific params 2025-05-31 22:46:07 -07:00
backend_deflate.h zram: add zlib compression backend support 2024-09-09 16:39:08 -07:00
backend_lz4.c zram: rename ZCOMP_PARAM_NO_LEVEL 2025-05-31 22:46:07 -07:00
backend_lz4.h zram: add lz4 compression backend support 2024-09-09 16:39:07 -07:00
backend_lz4hc.c zram: rename ZCOMP_PARAM_NO_LEVEL 2025-05-31 22:46:07 -07:00
backend_lz4hc.h zram: add lz4hc compression backend support 2024-09-09 16:39:07 -07:00
backend_lzo.c zram: move immutable comp params away from per-CPU context 2024-09-09 16:39:10 -07:00
backend_lzo.h zram: add lzo and lzorle compression backends support 2024-09-09 16:39:07 -07:00
backend_lzorle.c zram: move immutable comp params away from per-CPU context 2024-09-09 16:39:10 -07:00
backend_lzorle.h zram: add lzo and lzorle compression backends support 2024-09-09 16:39:07 -07:00
backend_zstd.c zram: rename ZCOMP_PARAM_NO_LEVEL 2025-05-31 22:46:07 -07:00
backend_zstd.h zram: add zstd compression backend support 2024-09-09 16:39:08 -07:00
Kconfig zram: ZRAM_DEF_COMP should depend on ZRAM 2024-11-11 17:22:27 -08:00
Makefile zram: add 842 compression backend support 2024-09-09 16:39:08 -07:00
zcomp.c zram: pass buffer offset to zcomp_available_show() 2025-07-03 19:56:51 -06:00
zcomp.h zram: pass buffer offset to zcomp_available_show() 2025-07-03 19:56:51 -06:00
zram_drv.c zram: pass buffer offset to zcomp_available_show() 2025-07-03 19:56:51 -06:00
zram_drv.h zram: remove writestall zram_stats member 2025-03-16 22:06:34 -07:00