]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
zram: rename init_lock to dev_lock
authorSergey Senozhatsky <senozhatsky@chromium.org>
Thu, 15 Jan 2026 08:08:07 +0000 (17:08 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 31 Jan 2026 22:22:36 +0000 (14:22 -0800)
commit6efc548d8a08ae918020225e16d040ce3903bff7
treed234bf52546f4fe316b1a30a14226b88e276426d
parentc0f609f799212e8ae0086b83a24ac616e0cd5696
zram: rename init_lock to dev_lock

init_lock has completely outgrown its initial purpose and is no longer
used only to "prevent concurrent execution of device init" as the stale
comment suggests.  The scope of this lock is much bigger now.

These days this lock (rw_semaphore) controls how a task owns the
corresponding zram device: either in shared mode or in exclusive mode.

All zram device attribute writes should own the device in exclusive mode,
which synchronizes these tasks and prevents, for example, concurrent
execution of recompression and writeback.

All zram device attribute reads should own the device in shared mode.

Rename the lock to dev_lock to better reflect its current purpose.

Link: https://lkml.kernel.org/r/20260115080807.3957860-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.h