Skip to content

Commit 47edc84

Browse files
mikechristiemartinkpetersen
authored andcommitted
scsi: target: tcm_fc: Convert to new submission API
target_submit_cmd() is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session(). tcm_fc uses target_stop_session() to sync session shutdown with LIO core, so we use target_init_cmd(), target_submit_prep(), target_submit(), because target_init_cmd() will now detect the target_stop_session() call and return an error. Link: https://lore.kernel.org/r/20210227170006.5077-14-michael.christie@oracle.com Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 1f48b06 commit 47edc84

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎drivers/target/tcm_fc/tfc_cmd.c‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,16 +543,22 @@ static void ft_send_work(struct work_struct *work)
543543

544544
fc_seq_set_resp(cmd->seq, ft_recv_seq, cmd);
545545
cmd->se_cmd.tag = fc_seq_exch(cmd->seq)->rxid;
546+
546547
/*
547548
* Use a single se_cmd->cmd_kref as we expect to release se_cmd
548549
* directly from ft_check_stop_free callback in response path.
549550
*/
550-
if (target_submit_cmd(&cmd->se_cmd, cmd->sess->se_sess, fcp->fc_cdb,
551-
&cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun),
552-
ntohl(fcp->fc_dl), task_attr, data_dir,
553-
TARGET_SCF_ACK_KREF))
551+
if (target_init_cmd(&cmd->se_cmd, cmd->sess->se_sess,
552+
&cmd->ft_sense_buffer[0],
553+
scsilun_to_int(&fcp->fc_lun), ntohl(fcp->fc_dl),
554+
task_attr, data_dir, TARGET_SCF_ACK_KREF))
554555
goto err;
555556

557+
if (target_submit_prep(&cmd->se_cmd, fcp->fc_cdb, NULL, 0, NULL, 0,
558+
NULL, 0))
559+
return;
560+
561+
target_submit(&cmd->se_cmd);
556562
pr_debug("r_ctl %x target_submit_cmd %p\n", fh->fh_r_ctl, cmd);
557563
return;
558564

0 commit comments

Comments
 (0)