bdev/nvme: Consolidate exit paths of get_buf_cb()
I/Os will be retried if spdk_bdev_io_complete() is called with SPDK_BDEV_IO_STATUS_FAILED. To do it easier, consolidate exit paths of bdev_nvme_get_buf_cb(). Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I0a67b88a107d616c5a5b0fc5ff963ad1402f5651 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7487 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
c41508b7e2
commit
b2c0e3761b
@ -707,13 +707,13 @@ bdev_nvme_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io,
|
||||
int ret;
|
||||
|
||||
if (!success) {
|
||||
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
return;
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (spdk_unlikely(!bdev_nvme_find_io_path(nbdev, nvme_ch, &nvme_ns, &qpair))) {
|
||||
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
return;
|
||||
ret = -ENXIO;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = bdev_nvme_readv(nvme_ns->ns,
|
||||
@ -726,6 +726,7 @@ bdev_nvme_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io,
|
||||
bdev_io->u.bdev.offset_blocks,
|
||||
bdev->dif_check_flags);
|
||||
|
||||
exit:
|
||||
if (spdk_likely(ret == 0)) {
|
||||
return;
|
||||
} else if (ret == -ENOMEM) {
|
||||
|
Loading…
Reference in New Issue
Block a user