Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: kbusch@kernel.org, sagi@grimberg.me,
	linux-nvme@lists.infradead.org, hch@lst.de
Subject: Re: [PATCH V6 1/5] nvme: centralize setting req timeout
Date: Thu, 5 Nov 2020 08:31:13 +0100	[thread overview]
Message-ID: <20201105073113.GB4540@lst.de> (raw)
In-Reply-To: <20201104203736.62745-2-chaitanya.kulkarni@wdc.com>

On Wed, Nov 04, 2020 at 12:37:32PM -0800, Chaitanya Kulkarni wrote:
>  
> +static inline void nvme_req_set_default_timeout(struct request *req)
> +{
> +	if (req->q->queuedata)
> +		req->timeout = NVME_IO_TIMEOUT;
> +	else /* no queuedata implies admin queue */
> +		req->timeout = ADMIN_TIMEOUT;
> +}

This just has a single caller now, so I think we can open code it.

> +
>  struct request *nvme_alloc_request(struct request_queue *q,
> -		struct nvme_command *cmd, blk_mq_req_flags_t flags, int qid)
> +		struct nvme_command *cmd, blk_mq_req_flags_t flags, int qid,
> +		unsigned int timeout)
>  {
>  	unsigned op = nvme_is_write(cmd) ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN;
>  	struct request *req;
> @@ -533,6 +542,11 @@ struct request *nvme_alloc_request(struct request_queue *q,
>  	if (IS_ERR(req))
>  		return req;
>  
> +	if (timeout)
> +		req->timeout = timeout;
> +	else
> +		nvme_req_set_default_timeout(req);

No need to pass the timeout argument here.  The callers that care
can set it in the caller instead of adding another parameter.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2020-11-05  7:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 20:37 [PATCH V6 0/5] nvme-core: timeout related fixes and cleanup Chaitanya Kulkarni
2020-11-04 20:37 ` [PATCH V6 1/5] nvme: centralize setting req timeout Chaitanya Kulkarni
2020-11-04 22:10   ` Sagi Grimberg
2020-11-05  7:31   ` Christoph Hellwig [this message]
2020-11-04 20:37 ` [PATCH V6 2/5] nvmet: add passthru admin timeout value attr Chaitanya Kulkarni
2020-11-04 22:13   ` Sagi Grimberg
     [not found]     ` <BYAPR04MB49655CAAD9809FFC21D5418686EE0@BYAPR04MB4965.namprd04.prod.outlook.com>
2020-11-05  7:32       ` hch
2020-11-05  7:33   ` Christoph Hellwig
2020-11-04 20:37 ` [PATCH V6 3/5] nvmet: add passthru io " Chaitanya Kulkarni
2020-11-04 22:13   ` Sagi Grimberg
2020-11-04 20:37 ` [PATCH V6 4/5] nvme: use consistent macro name for timeout Chaitanya Kulkarni
2020-11-04 22:14   ` Sagi Grimberg
2020-11-04 20:37 ` [PATCH V6 5/5] nvme: centralize setting req end_io_data Chaitanya Kulkarni
2020-11-04 22:17   ` Sagi Grimberg
2020-11-05  7:28     ` Christoph Hellwig

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=20201105073113.GB4540@lst.de \
    --to=hch@lst.de \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox