vhost: remove struct spdk_vhost_dev_destroy_ctx
First of all, this struct was used when stopping a session and wasn't directly related to any vhost device despite its name. Second, the struct contained just a single poller. Instead of renaming it, we remove it. We can use that poller pointer directly. Change-Id: I66ad0826f7e809365c07662e59979b1942243c2e Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448225 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b4abd4c9d9
commit
72fa59f497
@ -78,7 +78,7 @@ struct spdk_vhost_blk_session {
|
||||
struct spdk_vhost_blk_dev *bvdev;
|
||||
struct spdk_poller *requestq_poller;
|
||||
struct spdk_io_channel *io_channel;
|
||||
struct spdk_vhost_dev_destroy_ctx destroy_ctx;
|
||||
struct spdk_poller *stop_poller;
|
||||
};
|
||||
|
||||
/* forward declaration */
|
||||
@ -766,7 +766,7 @@ destroy_session_poller_cb(void *arg)
|
||||
}
|
||||
|
||||
free_task_pool(bvsession);
|
||||
spdk_poller_unregister(&bvsession->destroy_ctx.poller);
|
||||
spdk_poller_unregister(&bvsession->stop_poller);
|
||||
spdk_vhost_session_event_done(vsession, 0);
|
||||
|
||||
return -1;
|
||||
@ -785,8 +785,8 @@ spdk_vhost_blk_stop_cb(struct spdk_vhost_dev *vdev,
|
||||
}
|
||||
|
||||
spdk_poller_unregister(&bvsession->requestq_poller);
|
||||
bvsession->destroy_ctx.poller = spdk_poller_register(destroy_session_poller_cb,
|
||||
bvsession, 1000);
|
||||
bvsession->stop_poller = spdk_poller_register(destroy_session_poller_cb,
|
||||
bvsession, 1000);
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
@ -184,10 +184,6 @@ struct spdk_vhost_dev {
|
||||
TAILQ_ENTRY(spdk_vhost_dev) tailq;
|
||||
};
|
||||
|
||||
struct spdk_vhost_dev_destroy_ctx {
|
||||
struct spdk_poller *poller;
|
||||
};
|
||||
|
||||
/**
|
||||
* Synchronized vhost session event used for backend callbacks.
|
||||
*
|
||||
|
@ -152,7 +152,7 @@ struct spdk_vhost_nvme_dev {
|
||||
TAILQ_ENTRY(spdk_vhost_nvme_dev) tailq;
|
||||
STAILQ_HEAD(, spdk_vhost_nvme_task) free_tasks;
|
||||
struct spdk_poller *requestq_poller;
|
||||
struct spdk_vhost_dev_destroy_ctx destroy_ctx;
|
||||
struct spdk_poller *stop_poller;
|
||||
};
|
||||
|
||||
static const struct spdk_vhost_dev_backend spdk_vhost_nvme_device_backend;
|
||||
@ -1180,7 +1180,7 @@ destroy_device_poller_cb(void *arg)
|
||||
nvme->dbbuf_eis = NULL;
|
||||
nvme->dataplane_started = false;
|
||||
|
||||
spdk_poller_unregister(&nvme->destroy_ctx.poller);
|
||||
spdk_poller_unregister(&nvme->stop_poller);
|
||||
spdk_vhost_session_event_done(nvme->vsession, 0);
|
||||
|
||||
return -1;
|
||||
@ -1201,7 +1201,7 @@ spdk_vhost_nvme_stop_cb(struct spdk_vhost_dev *vdev,
|
||||
SPDK_NOTICELOG("Stopping Device %u, Path %s\n", vsession->vid, vdev->path);
|
||||
|
||||
spdk_poller_unregister(&nvme->requestq_poller);
|
||||
nvme->destroy_ctx.poller = spdk_poller_register(destroy_device_poller_cb, nvme, 1000);
|
||||
nvme->stop_poller = spdk_poller_register(destroy_device_poller_cb, nvme, 1000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ struct spdk_vhost_scsi_session {
|
||||
struct spdk_scsi_dev_vhost_state scsi_dev_state[SPDK_VHOST_SCSI_CTRLR_MAX_DEVS];
|
||||
struct spdk_poller *requestq_poller;
|
||||
struct spdk_poller *mgmt_poller;
|
||||
struct spdk_vhost_dev_destroy_ctx destroy_ctx;
|
||||
struct spdk_poller *stop_poller;
|
||||
};
|
||||
|
||||
struct spdk_vhost_scsi_task {
|
||||
@ -1382,7 +1382,7 @@ destroy_session_poller_cb(void *arg)
|
||||
|
||||
free_task_pool(svsession);
|
||||
|
||||
spdk_poller_unregister(&svsession->destroy_ctx.poller);
|
||||
spdk_poller_unregister(&svsession->stop_poller);
|
||||
spdk_vhost_session_event_done(vsession, 0);
|
||||
|
||||
return -1;
|
||||
@ -1398,8 +1398,8 @@ spdk_vhost_scsi_stop_cb(struct spdk_vhost_dev *vdev,
|
||||
assert(svsession != NULL);
|
||||
spdk_poller_unregister(&svsession->requestq_poller);
|
||||
spdk_poller_unregister(&svsession->mgmt_poller);
|
||||
svsession->destroy_ctx.poller = spdk_poller_register(destroy_session_poller_cb,
|
||||
svsession, 1000);
|
||||
svsession->stop_poller = spdk_poller_register(destroy_session_poller_cb,
|
||||
svsession, 1000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user