[PATCH 7/7] zram: rename mark_idle() to mark_slots_idle()

From: Sergey Senozhatsky

Date: Tue Dec 01 2026 - 04:07:47 EST


Rename mark_idle() to mark_slots_idle() so that its naming
follows current zram conventions: mark_slot_accessed(),
set_slot_flag(), etc.

While at it, fix up the comments (there is no init lock
anymore, and the cutoff check has always been strict)
and make trivial coding style tweaks.

Signed-off-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
---
drivers/block/zram/zram_drv.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 6a48f11b26c0..36873b655d66 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -429,10 +429,10 @@ static ssize_t mem_used_max_store(struct device *dev,
}

/*
- * Mark all pages which are older than or equal to cutoff as IDLE.
- * Callers should hold the zram init lock in read mode
+ * Mark all slots which are older than cutoff as IDLE.
+ * Callers should hold the zram dev lock in read mode
*/
-static void mark_idle(struct zram *zram, time64_t cutoff)
+static void mark_slots_idle(struct zram *zram, time64_t cutoff)
{
int is_idle = 1;
unsigned long nr_pages = zram->disksize >> PAGE_SHIFT;
@@ -455,8 +455,7 @@ static void mark_idle(struct zram *zram, time64_t cutoff)
}

#ifdef CONFIG_ZRAM_TRACK_ENTRY_ACTIME
- is_idle = !cutoff ||
- cutoff > zram->table[index].attr.ac_time;
+ is_idle = !cutoff || cutoff > zram->table[index].attr.ac_time;
#endif
if (is_idle)
set_slot_flag(zram, index, ZRAM_IDLE);
@@ -497,10 +496,9 @@ static ssize_t idle_store(struct device *dev, struct device_attribute *attr,
return -EINVAL;

/*
- * A cutoff of 0 marks everything as idle, this is the
- * "all" behavior.
+ * A cutoff of 0 marks everything as idle, this is the "all" behavior.
*/
- mark_idle(zram, cutoff);
+ mark_slots_idle(zram, cutoff);
return len;
}

--
2.56.1.839.g22a8290db9-goog