Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

zram: change scan_slots to return void

scan_slots_for_writeback() and scan_slots_for_recompress() work in a "best
effort" fashion, if they cannot allocate memory for a new pp-slot
candidate they just return and post-processing selects slots that were
successfully scanned thus far. scan_slots functions never return errors
and their callers never check the return status, so convert them to return
void.

Link: https://lkml.kernel.org/r/20260317032349.753645-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Sergey Senozhatsky and committed by
Andrew Morton
cba82993 4bdbddb4

+5 -9
+5 -9
drivers/block/zram/zram_drv.c
··· 1196 1196 return 0; 1197 1197 } 1198 1198 1199 - static int scan_slots_for_writeback(struct zram *zram, u32 mode, 1200 - unsigned long lo, unsigned long hi, 1201 - struct zram_pp_ctl *ctl) 1199 + static void scan_slots_for_writeback(struct zram *zram, u32 mode, 1200 + unsigned long lo, unsigned long hi, 1201 + struct zram_pp_ctl *ctl) 1202 1202 { 1203 1203 u32 index = lo; 1204 1204 ··· 1230 1230 break; 1231 1231 index++; 1232 1232 } 1233 - 1234 - return 0; 1235 1233 } 1236 1234 1237 1235 static ssize_t writeback_store(struct device *dev, ··· 2366 2368 return true; 2367 2369 } 2368 2370 2369 - static int scan_slots_for_recompress(struct zram *zram, u32 mode, u32 prio, 2370 - struct zram_pp_ctl *ctl) 2371 + static void scan_slots_for_recompress(struct zram *zram, u32 mode, u32 prio, 2372 + struct zram_pp_ctl *ctl) 2371 2373 { 2372 2374 unsigned long nr_pages = zram->disksize >> PAGE_SHIFT; 2373 2375 unsigned long index; ··· 2402 2404 if (!ok) 2403 2405 break; 2404 2406 } 2405 - 2406 - return 0; 2407 2407 } 2408 2408 2409 2409 /*