]> www.infradead.org Git - users/hch/misc.git/commit
block: move q->sysfs_lock and queue-freeze under show/store method
authorNilay Shroff <nilay@linux.ibm.com>
Tue, 4 Mar 2025 10:22:31 +0000 (15:52 +0530)
committerJens Axboe <axboe@kernel.dk>
Mon, 10 Mar 2025 13:30:18 +0000 (07:30 -0600)
commitb07a889e833555735ce72ca4a6d39f4c2ca725ba
tree2a7e7fa712a2b4fdc83c5d36bea2505c2cef9b14
parent6e51a1279cd60cb93e3379ff140d8fa6c39ecf20
block: move q->sysfs_lock and queue-freeze under show/store method

In preparation to further simplify and group sysfs attributes which
don't require locking or require some form of locking other than q->
limits_lock, move acquire/release of q->sysfs_lock and queue freeze/
unfreeze under each attributes' respective show/store method.

While we are at it, also remove ->load_module() as it's used to load
the module before queue is freezed. Now as we moved queue-freeze under
->store(), we could load module directly from the attributes' store
method before we actually start freezing the queue. Currently, the
->load_module() is only used by "scheduler" attribute, so we now load
the relevant elevator module before we start freezing the queue in
elv_iosched_store().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://lore.kernel.org/r/20250304102551.2533767-3-nilay@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-sysfs.c
block/elevator.c