lib/scsi: Inline _scsi_lun_execute_mgmt_task() into the caller function
Inline _scsi_lun_execute_mgmt_task() into the caller function spdk_scsi_lun_execute_mgmt_task() as another preparation to the following patches to avoid using double underscores as the prefix of the function name. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I3c282fff133dfe7afc70c374a2186c14d1eb766c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1829 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
2144f0b4c3
commit
2aa74d8ba9
@ -116,10 +116,30 @@ spdk_scsi_lun_complete_reset_task(struct spdk_scsi_lun *lun, struct spdk_scsi_ta
|
||||
scsi_lun_complete_mgmt_task(lun, task);
|
||||
}
|
||||
|
||||
static void
|
||||
_scsi_lun_execute_mgmt_task(struct spdk_scsi_lun *lun,
|
||||
struct spdk_scsi_task *task)
|
||||
void
|
||||
spdk_scsi_lun_append_mgmt_task(struct spdk_scsi_lun *lun,
|
||||
struct spdk_scsi_task *task)
|
||||
{
|
||||
TAILQ_INSERT_TAIL(&lun->pending_mgmt_tasks, task, scsi_link);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_scsi_lun_execute_mgmt_task(struct spdk_scsi_lun *lun)
|
||||
{
|
||||
struct spdk_scsi_task *task;
|
||||
|
||||
if (!TAILQ_EMPTY(&lun->mgmt_tasks)) {
|
||||
return;
|
||||
}
|
||||
|
||||
task = TAILQ_FIRST(&lun->pending_mgmt_tasks);
|
||||
if (spdk_likely(task == NULL)) {
|
||||
/* Try to execute all pending tasks */
|
||||
spdk_scsi_lun_execute_tasks(lun);
|
||||
return;
|
||||
}
|
||||
TAILQ_REMOVE(&lun->pending_mgmt_tasks, task, scsi_link);
|
||||
|
||||
TAILQ_INSERT_TAIL(&lun->mgmt_tasks, task, scsi_link);
|
||||
|
||||
if (lun->removed) {
|
||||
@ -157,33 +177,6 @@ _scsi_lun_execute_mgmt_task(struct spdk_scsi_lun *lun,
|
||||
scsi_lun_complete_mgmt_task(lun, task);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_scsi_lun_append_mgmt_task(struct spdk_scsi_lun *lun,
|
||||
struct spdk_scsi_task *task)
|
||||
{
|
||||
TAILQ_INSERT_TAIL(&lun->pending_mgmt_tasks, task, scsi_link);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_scsi_lun_execute_mgmt_task(struct spdk_scsi_lun *lun)
|
||||
{
|
||||
struct spdk_scsi_task *task;
|
||||
|
||||
if (!TAILQ_EMPTY(&lun->mgmt_tasks)) {
|
||||
return;
|
||||
}
|
||||
|
||||
task = TAILQ_FIRST(&lun->pending_mgmt_tasks);
|
||||
if (spdk_likely(task == NULL)) {
|
||||
/* Try to execute all pending tasks */
|
||||
spdk_scsi_lun_execute_tasks(lun);
|
||||
return;
|
||||
}
|
||||
TAILQ_REMOVE(&lun->pending_mgmt_tasks, task, scsi_link);
|
||||
|
||||
_scsi_lun_execute_mgmt_task(lun, task);
|
||||
}
|
||||
|
||||
static void
|
||||
_scsi_lun_execute_task(struct spdk_scsi_lun *lun, struct spdk_scsi_task *task)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user