scsi: Unify the name of functions and variables about hot remove

Change the name of hot plug to hot remove not to confuse.

Change-Id: Ifc8de3452de72a08eba0e9ea942217e5342b2ef4
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/414352
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2018-06-08 14:43:07 +09:00 committed by Jim Harris
parent f9117f050e
commit edf924824e
2 changed files with 19 additions and 12 deletions

View File

@ -181,19 +181,25 @@ spdk_scsi_lun_execute_task(struct spdk_scsi_lun *lun, struct spdk_scsi_task *tas
} }
} }
static void
spdk_scsi_lun_remove(struct spdk_scsi_lun *lun)
{
spdk_scsi_lun_free_io_channel(lun);
spdk_bdev_close(lun->bdev_desc);
spdk_poller_unregister(&lun->hotremove_poller);
spdk_scsi_dev_delete_lun(lun->dev, lun);
free(lun);
}
static int static int
spdk_scsi_lun_hotplug(void *arg) spdk_scsi_lun_hot_remove_poll(void *arg)
{ {
struct spdk_scsi_lun *lun = (struct spdk_scsi_lun *)arg; struct spdk_scsi_lun *lun = (struct spdk_scsi_lun *)arg;
if (!spdk_scsi_lun_has_pending_tasks(lun)) { if (!spdk_scsi_lun_has_pending_tasks(lun)) {
spdk_scsi_lun_free_io_channel(lun); spdk_scsi_lun_remove(lun);
spdk_bdev_close(lun->bdev_desc);
spdk_poller_unregister(&lun->hotplug_poller);
spdk_scsi_dev_delete_lun(lun->dev, lun);
free(lun);
} }
return -1; return -1;
@ -209,9 +215,10 @@ _spdk_scsi_lun_hot_remove(void *arg1)
} }
if (spdk_scsi_lun_has_pending_tasks(lun)) { if (spdk_scsi_lun_has_pending_tasks(lun)) {
lun->hotplug_poller = spdk_poller_register(spdk_scsi_lun_hotplug, lun, 10); lun->hotremove_poller = spdk_poller_register(spdk_scsi_lun_hot_remove_poll,
lun, 10);
} else { } else {
spdk_scsi_lun_hotplug(lun); spdk_scsi_lun_remove(lun);
} }
} }

View File

@ -97,10 +97,10 @@ struct spdk_scsi_lun {
uint32_t ref; uint32_t ref;
/** Poller to release the resource of the lun when it is hot removed */ /** Poller to release the resource of the lun when it is hot removed */
struct spdk_poller *hotplug_poller; struct spdk_poller *hotremove_poller;
/** The LUN is removed */ /** The LUN is removed */
bool removed; bool removed;
/** Callback to be fired when LUN removal is first triggered. */ /** Callback to be fired when LUN removal is first triggered. */
void (*hotremove_cb)(const struct spdk_scsi_lun *lun, void *arg); void (*hotremove_cb)(const struct spdk_scsi_lun *lun, void *arg);