From 72fa59f4971e8b01cf827b8b9ab10ca77ecc6522 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Sun, 17 Mar 2019 00:31:45 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448225 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- lib/vhost/vhost_blk.c | 8 ++++---- lib/vhost/vhost_internal.h | 4 ---- lib/vhost/vhost_nvme.c | 6 +++--- lib/vhost/vhost_scsi.c | 8 ++++---- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c index b76fbd61e8..6e789d1062 100644 --- a/lib/vhost/vhost_blk.c +++ b/lib/vhost/vhost_blk.c @@ -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: diff --git a/lib/vhost/vhost_internal.h b/lib/vhost/vhost_internal.h index e7b30dcd60..c2a30809a5 100644 --- a/lib/vhost/vhost_internal.h +++ b/lib/vhost/vhost_internal.h @@ -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. * diff --git a/lib/vhost/vhost_nvme.c b/lib/vhost/vhost_nvme.c index 62773f31f6..b2fbc852ff 100644 --- a/lib/vhost/vhost_nvme.c +++ b/lib/vhost/vhost_nvme.c @@ -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; } diff --git a/lib/vhost/vhost_scsi.c b/lib/vhost/vhost_scsi.c index eaeecbc343..5745273af5 100644 --- a/lib/vhost/vhost_scsi.c +++ b/lib/vhost/vhost_scsi.c @@ -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; }