Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> --- drivers/target/tcm_fc/tcm_fc.h | 1 + drivers/target/tcm_fc/tfc_io.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h index 15a2249..b453d23 100644 --- a/drivers/target/tcm_fc/tcm_fc.h +++ b/drivers/target/tcm_fc/tcm_fc.h @@ -168,6 +168,7 @@ void ft_recv_req(struct ft_sess *, struct fc_frame *); struct ft_tpg *ft_lport_find_tpg(struct fc_lport *); struct ft_node_acl *ft_acl_get(struct ft_tpg *, struct fc_rport_priv *); +void ft_queue_execute_work(struct ft_cmd *cmd); void ft_recv_write_data(struct ft_cmd *, struct fc_frame *); void ft_dump_cmd(struct ft_cmd *, const char *caller); diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c index b93d110..7fb9fb3 100644 --- a/drivers/target/tcm_fc/tfc_io.c +++ b/drivers/target/tcm_fc/tfc_io.c @@ -220,6 +220,12 @@ static void ft_execute_work(struct work_struct *work) target_execute_cmd(&cmd->se_cmd); } +void ft_queue_execute_work(struct ft_cmd *cmd) +{ + INIT_WORK(&cmd->work, ft_execute_work); + queue_work(cmd->sess->tport->tpg->workqueue, &cmd->work); +} + /* * Receive write data frame. */ @@ -347,11 +353,11 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp) mem_len -= tlen; cmd->write_data_len += tlen; } + last_frame: - if (cmd->write_data_len == se_cmd->data_length) { - INIT_WORK(&cmd->work, ft_execute_work); - queue_work(cmd->sess->tport->tpg->workqueue, &cmd->work); - } + if (cmd->write_data_len == se_cmd->data_length) + ft_queue_execute_work(cmd); + drop: fc_frame_free(fp); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html