[PATCH] NVMe: allow discard timeouts to be configurable

Jens Axboe axboe at fb.com
Sat Apr 18 13:13:51 PDT 2015


On 04/18/2015 02:11 PM, Christoph Hellwig wrote:
>>   static void nvme_set_info(struct nvme_cmd_info *cmd, void *ctx,
>>   				nvme_completion_fn handler)
>>   {
>> +	struct request *rq = blk_mq_rq_from_pdu(cmd);
>> +
>>   	cmd->fn = handler;
>>   	cmd->ctx = ctx;
>>   	cmd->aborted = 0;
>> -	blk_mq_start_request(blk_mq_rq_from_pdu(cmd));
>> +
>> +	if (rq->cmd_flags & REQ_DISCARD)
>> +		rq->timeout = nvme_discard_timeout * HZ;
>> +
>
> Can you move this to the discard-specific branch of nvme_queue_rq
> please?

Sure, I just wanted to keep it closer to where we call start request. 
But I can move it, does save a branch.

-- 
Jens Axboe




More information about the Linux-nvme mailing list