[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49647ccf-5d19-4ede-87b4-0f7ff8e9f5ea@acm.org>
Date: Thu, 9 Oct 2025 10:05:27 -0700
From: Bart Van Assche <bvanassche@....org>
To: Yu Kuai <yukuai1@...weicloud.com>, axboe@...nel.dk, ming.lei@...hat.com,
nilay@...ux.ibm.com, jmoyer@...hat.com
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
yukuai3@...wei.com, yi.zhang@...wei.com, yangerkun@...wei.com,
johnny.chenyi@...wei.com
Subject: Re: [patch v2 3/7] blk-mq: add a new queue sysfs attribute
async_depth
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, ...).
Thanks,
Bart.
Powered by blists - more mailing lists