Re: [PATCH v2] ublk: Add UBLK_U_CMD_UPDATE_SIZE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux