[PATCH 2/3] nvme: refactor command completion

Christoph Hellwig hch at lst.de
Sat Aug 15 02:54:24 EDT 2020


On Fri, Aug 14, 2020 at 11:37:14AM -0700, Sagi Grimberg wrote:

[fullquote deleted, sigh..]

> Would be better to reuse nvme_is_ana_error I think so we
> don't need to maintain ana status codes in both places:
>
> static inline bool nvme_is_path_error(u16 status)
> {
> 	if (nvme_is_ana_error(status))
> 		return true;
> 	switch (status & 0x7ff) {
> 	case NVME_SC_HOST_PATH_ERROR:
> 	case NVME_SC_HOST_ABORTED_CMD:
> 		return true;
> 	default:
> 		return false;
> 	}
> }

I initially had:

static inline bool nvme_is_path_error(u16 status)
{
	switch (status & 0x7ff) {
	case NVME_SC_HOST_PATH_ERROR:
	case NVME_SC_HOST_ABORTED_CMD:
		return true;
	default:
		return nvme_is_ana_error(status);
	}
}

but found that a little weird, but I can go back to it.



More information about the Linux-nvme mailing list