Re: [patch v2 3/7] blk-mq: add a new queue sysfs attribute async_depth
From: Yu Kuai
Date: Thu Oct 09 2025 - 13:20:03 EST
Hi,
在 2025/10/10 1:05, Bart Van Assche 写道:
On 10/9/25 12:46 AM, Yu Kuai wrote:
+static ssize_t queue_async_depth_show(struct gendisk *disk, char *page)
+{
+ ssize_t ret;
+
+ mutex_lock(&disk->queue->elevator_lock);
+ ret = queue_var_show(disk->queue->async_depth, page);
+ mutex_unlock(&disk->queue->elevator_lock);
+ return ret;
+}
Functions like the above can be simplified by using guard(mutex)(...) or
scoped_guard(mutex, ...).
Yeah, sounds good. I'm still not used to this.
Thanks,
Kuai
Thanks,
Bart.