Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] null_blk: poll queue support
Date: Mon, 19 Apr 2021 13:48:09 -0600
Message-ID: <68a28d55-8c50-31e3-505a-2de330914942@kernel.dk> (raw)
In-Reply-To: <BYAPR04MB49654A1D4AC52FA3A8110240864A9@BYAPR04MB4965.namprd04.prod.outlook.com>

On 4/17/21 10:49 PM, Chaitanya Kulkarni wrote:
> On 4/17/21 08:30, Jens Axboe wrote:
>> +		cmd->error = null_process_cmd(cmd, req_op(req), blk_rq_pos(req),
>> +						blk_rq_sectors(req));
> 
> How about following on the top of this patch ?
> 
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index 8efaf21cc053..4c27e37ccc51 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -1496,6 +1496,7 @@ static int null_map_queues(struct blk_mq_tag_set *set)
>  static int null_poll(struct blk_mq_hw_ctx *hctx)
>  {
>         struct nullb_queue *nq = hctx->driver_data;
> +       blk_status_t sts;
>         LIST_HEAD(list);
>         int nr = 0;
>  
> @@ -1510,8 +1511,16 @@ static int null_poll(struct blk_mq_hw_ctx *hctx)
>                 req = list_first_entry(&list, struct request, queuelist);
>                 list_del_init(&req->queuelist);
>                 cmd = blk_mq_rq_to_pdu(req);
> -               cmd->error = null_process_cmd(cmd, req_op(req),
> blk_rq_pos(req),
> -                                               blk_rq_sectors(req));
> +               if (cmd->nq->dev->zoned)
> +                       sts = null_process_zoned_cmd(cmd, req_op(req),
> +                                                    blk_rq_pos(req),
> +                                                    blk_rq_sectors(req));
> +               else
> +                       sts = null_process_cmd(cmd, req_op(req),
> blk_rq_pos(req),
> +                                              blk_rq_sectors(req));
> +
> +               cmd->error = sts;
> +
>                 nullb_complete_cmd(cmd);
>                 nr++;
>         }
> 
> If you are okay I can send a well tested patch with little bit code
> cleanup once this is in the tree.

Yes, that might be a good idea. I'll just fold it in, I've got it
sitting separately so far. Just let me know when you've tested it.

-- 
Jens Axboe


  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17 15:29 Jens Axboe
2021-04-18  4:48 ` Chaitanya Kulkarni
2021-04-18  4:49 ` Chaitanya Kulkarni
2021-04-19 19:48   ` Jens Axboe [this message]
2021-04-19 22:19     ` Chaitanya Kulkarni
2021-04-19 22:55       ` Jens Axboe
2021-05-03 15:47 ` Bart Van Assche
2021-05-03 17:42   ` Jens Axboe
2021-05-04  0:32     ` Bart Van Assche

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=68a28d55-8c50-31e3-505a-2de330914942@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=linux-block@vger.kernel.org \
    /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

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git