[PATCH V13 2/4] nvmet: add ZBD over ZNS backend support

Christoph Hellwig hch at lst.de
Fri Apr 9 06:40:53 BST 2021


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.



More information about the Linux-nvme mailing list