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: Christoph Hellwig <hch@lst.de>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Damien Le Moal <Damien.LeMoal@wdc.com>
Subject: Re: [PATCH V13 2/4] nvmet: add ZBD over ZNS backend support
Date: Fri, 9 Apr 2021 07:40:53 +0200	[thread overview]
Message-ID: <20210409054053.GA2783@lst.de> (raw)
In-Reply-To: <BYAPR04MB496576AC2F66933D9509A22286749@BYAPR04MB4965.namprd04.prod.outlook.com>

On Thu, Apr 08, 2021 at 09:14:24PM +0000, Chaitanya Kulkarni wrote:
> >> +	if (rz->zrasf == NVME_ZRASF_ZONE_REPORT_ALL)
> >> +		goto record_zone;
> >> +
> >> +	/*
> >> +	 * Make sure this zone condition's value is mapped to NVMe ZNS zone
> >> +	 * condition value.
> >> +	 */
> >> +	if (z->cond > ARRAY_SIZE(blk_zcond_to_nvme_zstate) ||
> >> +	    !blk_zcond_to_nvme_zstate[z->cond])
> >> +		return -EINVAL;
> >> +
> >> +	/* filter zone by condition */
> >> +	if (blk_zcond_to_nvme_zstate[z->cond] != rz->zrasf)
> >> +		return 0;
> >> +
> >> +record_zone:
> > While not bad per se I ind the structure a little odd.  I'd move the
> > checks into a level of indentation instead.
> >
> 
> Can you please elaborate on this ?

If we have a condition that limits a query having that inside the
conditional just flows much easier than a goto that jumps over the
checks.

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

  reply	other threads:[~2021-04-09  5:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  0:14 [PATCH V13 0/4] nvmet: add ZBD backend support Chaitanya Kulkarni
2021-04-08  0:14 ` [PATCH V13 1/4] nvmet: add NVM Command Set Identifier support Chaitanya Kulkarni
2021-04-08  7:15   ` Christoph Hellwig
2021-04-08  0:14 ` [PATCH V13 2/4] nvmet: add ZBD over ZNS backend support Chaitanya Kulkarni
2021-04-08  7:23   ` Christoph Hellwig
2021-04-08 21:14     ` Chaitanya Kulkarni
2021-04-09  5:40       ` Christoph Hellwig [this message]
2021-04-09  5:42         ` Chaitanya Kulkarni
2021-04-09  7:09     ` Chaitanya Kulkarni
2021-04-09  9:53       ` Christoph Hellwig
2021-04-08  8:01   ` Damien Le Moal
2021-04-08 22:06     ` Chaitanya Kulkarni
2021-04-08 22:33       ` Damien Le Moal
2021-04-08  8:15   ` Damien Le Moal
2021-04-08  0:14 ` [PATCH V13 3/4] nvmet: add nvmet_req_bio put helper for backends Chaitanya Kulkarni
2021-04-08  0:14 ` [PATCH V13 4/4] nvmet: add req cns error complete helper Chaitanya Kulkarni
2021-04-08  7:24   ` 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=20210409054053.GA2783@lst.de \
    --to=hch@lst.de \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=linux-nvme@lists.infradead.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
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