Commit 49cf3861 authored by Jim Harris's avatar Jim Harris
Browse files

bdev/nvme: clean up submit_request return codes



Some of the internal functions used to return the
number of bytes associated with a successfully submitted
IO, but that was changed a while ago to just return 0
for success.

So change some of the callers of these functions to
just look for != 0 for failure rather than < 0.  This
preps for some upcoming ENOMEM handling changes.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I0a66dd6bfac9053e0fd6103dee1ea36b20d902df

Reviewed-on: https://review.gerrithub.io/378856


Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent d5b441e0
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#include "spdk/nvme.h"
#include "spdk/io_channel.h"
#include "spdk/string.h"
#include "spdk/likely.h"

#include "spdk_internal/bdev.h"
#include "spdk_internal/log.h"
@@ -345,7 +346,7 @@ bdev_nvme_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
			      bdev_io->u.bdev.num_blocks,
			      bdev_io->u.bdev.offset_blocks);

	if (ret < 0) {
	if (ret != 0) {
		spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
	}
}
@@ -422,7 +423,9 @@ _bdev_nvme_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_
static void
bdev_nvme_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
{
	if (_bdev_nvme_submit_request(ch, bdev_io) < 0) {
	int rc = _bdev_nvme_submit_request(ch, bdev_io);

	if (spdk_unlikely(rc != 0)) {
		spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
	}
}