vhost/nvme: remove pointless task NULL check

task must be non-NULL in blk_unmap_complete_cb - it is retrieved from
child->parent, which is always set to a known good task in the only
call site.

Change-Id: I28dce62d4cb586311dc87f988c01aa0e03665e4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408393
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Daniel Verkamp 2018-04-19 13:11:11 -07:00
parent 8e098e4190
commit f6fa387f5b

View File

@ -343,15 +343,14 @@ blk_unmap_complete_cb(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg)
spdk_bdev_free_io(bdev_io);
}
if (task) {
task->num_children--;
if (!success) {
task->success = false;
}
if (!task->num_children) {
blk_request_complete_cb(NULL, task->success, task);
}
task->num_children--;
if (!success) {
task->success = false;
}
if (!task->num_children) {
blk_request_complete_cb(NULL, task->success, task);
}
STAILQ_INSERT_TAIL(&nvme->free_tasks, child, stailq);
}