From 1e5705ee6f1801fc5c0130fb7c8b3dffcef89613 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Thu, 28 Jun 2018 11:42:52 +0900 Subject: [PATCH] scsi: Make scsi_lun_free_io_channel public IO channel for LUN is used for hot removal as it is emphasized in the previous patches. In iSCSI, a SCSI device has multiple LUNs. So freeing only the IO channel of a LUN must be possible. Change-Id: I5b355200b4e173512a5aa4b7351534faf8839eef Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/417197 Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System --- include/spdk/scsi.h | 16 ++++++++++++++++ lib/scsi/scsi_internal.h | 2 -- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/spdk/scsi.h b/include/spdk/scsi.h index be027089d..308bd3a77 100644 --- a/include/spdk/scsi.h +++ b/include/spdk/scsi.h @@ -457,6 +457,22 @@ void spdk_scsi_task_copy_status(struct spdk_scsi_task *dst, struct spdk_scsi_tas */ void spdk_scsi_task_process_null_lun(struct spdk_scsi_task *task); +/** + * Allocate I/O channel for the LUN + * + * \param lun Logical unit. + * + * \return 0 on success, -1 on failure. + */ +int spdk_scsi_lun_allocate_io_channel(struct spdk_scsi_lun *lun); + +/** + * Free I/O channel from the logical unit + * + * \param lun Logical unit. + */ +void spdk_scsi_lun_free_io_channel(struct spdk_scsi_lun *lun); + #ifdef __cplusplus } #endif diff --git a/lib/scsi/scsi_internal.h b/lib/scsi/scsi_internal.h index 142b2ddf8..a8151a8fc 100644 --- a/lib/scsi/scsi_internal.h +++ b/lib/scsi/scsi_internal.h @@ -127,8 +127,6 @@ void spdk_scsi_lun_execute_task(struct spdk_scsi_lun *lun, struct spdk_scsi_task int spdk_scsi_lun_task_mgmt_execute(struct spdk_scsi_task *task, enum spdk_scsi_task_func func); void spdk_scsi_lun_complete_task(struct spdk_scsi_lun *lun, struct spdk_scsi_task *task); void spdk_scsi_lun_complete_mgmt_task(struct spdk_scsi_lun *lun, struct spdk_scsi_task *task); -int spdk_scsi_lun_allocate_io_channel(struct spdk_scsi_lun *lun); -void spdk_scsi_lun_free_io_channel(struct spdk_scsi_lun *lun); bool spdk_scsi_lun_has_pending_tasks(const struct spdk_scsi_lun *lun); struct spdk_scsi_dev *spdk_scsi_dev_get_list(void);