On 3/17/25 7:04 PM, Dongli Zhang wrote:
> @@ -1390,6 +1424,24 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct 
> vhost_virtqueue *vq)
>                       goto err;
>               }
> 
> +             if (unlikely(vq_log && log_num)) {
> +                     if (!cmd->tvc_log)
> +                             cmd->tvc_log = kmalloc_array(vq->dev->iov_limit,
> +                                                          
> sizeof(*cmd->tvc_log),
> +                                                          GFP_KERNEL);
> +
> +                     if (likely(cmd->tvc_log)) {
> +                             memcpy(cmd->tvc_log, vq->log,> +                
>                        sizeof(*cmd->tvc_log) * log_num);
> +                             cmd->tvc_log_num = log_num;


Hey Dongli, this approach seems ok.

Could you just move this to a function?

Reply via email to