]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
zram: fixup read_block_state()
authorSergey Senozhatsky <senozhatsky@chromium.org>
Thu, 15 Jan 2026 03:30:06 +0000 (12:30 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:24:38 +0000 (19:24 -0800)
ac_time is now in seconds, do not use ktime_to_timespec64()

[akpm@linux-foundation.org: remove now-unused local `ts']
[akpm@linux-foundation.org: fix build]
Link: https://lkml.kernel.org/r/20260115033031.3818977-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reported-by: Chris Mason <clm@meta.com>
Closes: https://lkml.kernel.org/r/20260114124522.1326519-1-clm@meta.com
Cc: Brian Geffon <bgeffon@google.com>
Cc: David Stevens <stevensd@google.com>
Cc: Minchan Kim <minchan@google.com>
Cc: Richard Chang <richardycc@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/zram_drv.c

index df30150e6ed80aae75406841ec40c1e0fcf6405e..7dcfc71d2cac45a102414324819b09ebc950db1e 100644 (file)
@@ -1570,7 +1570,6 @@ static ssize_t read_block_state(struct file *file, char __user *buf,
        ssize_t index, written = 0;
        struct zram *zram = file->private_data;
        unsigned long nr_pages = zram->disksize >> PAGE_SHIFT;
-       struct timespec64 ts;
 
        kbuf = kvmalloc(count, GFP_KERNEL);
        if (!kbuf)
@@ -1589,11 +1588,9 @@ static ssize_t read_block_state(struct file *file, char __user *buf,
                if (!slot_allocated(zram, index))
                        goto next;
 
-               ts = ktime_to_timespec64(zram->table[index].attr.ac_time);
                copied = snprintf(kbuf + written, count,
-                       "%12zd %12lld.%06lu %c%c%c%c%c%c\n",
-                       index, (s64)ts.tv_sec,
-                       ts.tv_nsec / NSEC_PER_USEC,
+                       "%12zd %12u.%06d %c%c%c%c%c%c\n",
+                       index, zram->table[index].attr.ac_time, 0,
                        test_slot_flag(zram, index, ZRAM_SAME) ? 's' : '.',
                        test_slot_flag(zram, index, ZRAM_WB) ? 'w' : '.',
                        test_slot_flag(zram, index, ZRAM_HUGE) ? 'h' : '.',