From: Jens Axboe <axboe@kernel.dk>
To: Jared Holzman <jholzman@nvidia.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Cc: Ming Lei <ming.lei@redhat.com>
Subject: Re: [PATCH v2] ublk: Add UBLK_U_CMD_UPDATE_SIZE
Date: Thu, 10 Apr 2025 07:28:45 -0600 [thread overview]
Message-ID: <27498cf6-37a2-4ed3-9009-cbe63e86c5bd@kernel.dk> (raw)
In-Reply-To: <d90ff20a-b324-49b8-bc63-7d7a35afd1f6@nvidia.com>
On 4/10/25 6:29 AM, Jared Holzman wrote:
> @@ -3052,6 +3053,22 @@ static int ublk_ctrl_get_features(struct io_uring_cmd *cmd)
> return 0;
> }
>
> +static int ublk_ctrl_set_size(struct ublk_device *ub,
> + struct io_uring_cmd *cmd)
Minor style nit, but that would fit on a single line, doesn't need to be
split in two.
> +{
> + const struct ublksrv_ctrl_cmd *header = io_uring_sqe_cmd(cmd->sqe);
> + struct ublk_param_basic *p = &ub->params.basic;
> + size_t new_size = (int)header->data[0];
> + int ret = 0;
> +
> + p->dev_sectors = new_size;
> +
> + mutex_lock(&ub->mutex);
> + set_capacity_and_notify(ub->ub_disk, p->dev_sectors);
> + mutex_unlock(&ub->mutex);
> +
> + return ret;
> +}
Get rid of 'ret' here, it's entirely unused. In fact maybe just get rid
of the return value in the first place, as the function can't fail?
--
Jens Axboe
next prev parent reply other threads:[~2025-04-10 13:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 12:29 [PATCH v2] ublk: Add UBLK_U_CMD_UPDATE_SIZE Jared Holzman
2025-04-10 13:28 ` Jens Axboe [this message]
2025-04-11 8:02 ` Ming Lei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27498cf6-37a2-4ed3-9009-cbe63e86c5bd@kernel.dk \
--to=axboe@kernel.dk \
--cc=jholzman@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.