[RFC 2/3] nvme: passthrough helper with callback

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Wed Mar 3 07:52:01 GMT 2021


On 3/2/21 23:22, Kanchan Joshi wrote:
> -void nvme_execute_passthru_rq(struct request *rq)
> +void nvme_execute_passthru_rq_common(struct request *rq,
> +			rq_end_io_fn *done)
>  {
>  	struct nvme_command *cmd = nvme_req(rq)->cmd;
>  	struct nvme_ctrl *ctrl = nvme_req(rq)->ctrl;
> @@ -1135,9 +1136,17 @@ void nvme_execute_passthru_rq(struct request *rq)
>  	u32 effects;
>  
>  	effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
> -	blk_execute_rq(disk, rq, 0);
> +	if (!done)
> +		blk_execute_rq(disk, rq, 0);
> +	else
> +		blk_execute_rq_nowait(disk, rq, 0, done);
>  	nvme_passthru_end(ctrl, effects);

This needs a detailed explanation in order to prove the correctness.





More information about the Linux-nvme mailing list