Skip to content

Commit

Permalink
scsi: target: core: Kill transport_handle_cdb_direct()
Browse files Browse the repository at this point in the history
Move the code from transport_handle_cdb_direct() to target_submit() and
have iSCSI call target_submit().

Signed-off-by: Mike Christie <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
mikechristie authored and martinkpetersen committed Oct 13, 2023
1 parent 5c48a4e commit 4289267
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion drivers/target/iscsi/iscsi_target_erl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ int iscsit_execute_cmd(struct iscsit_cmd *cmd, int ooo)

iscsit_set_unsolicited_dataout(cmd);
}
return transport_handle_cdb_direct(&cmd->se_cmd);
return target_submit(&cmd->se_cmd);

case ISCSI_OP_NOOP_OUT:
case ISCSI_OP_TEXT:
Expand Down
2 changes: 1 addition & 1 deletion drivers/target/iscsi/iscsi_target_tmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int iscsit_task_reassign_complete_read(
pr_debug("READ ITT: 0x%08x: t_state: %d never sent to"
" transport\n", cmd->init_task_tag,
cmd->se_cmd.t_state);
transport_handle_cdb_direct(se_cmd);
target_submit(se_cmd);
return 0;
}

Expand Down
27 changes: 8 additions & 19 deletions drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,12 +1575,14 @@ target_cmd_parse_cdb(struct se_cmd *cmd)
}
EXPORT_SYMBOL(target_cmd_parse_cdb);

/*
* Used by fabric module frontends to queue tasks directly.
* May only be used from process context.
/**
* target_submit - perform final initialization and submit cmd to LIO core
* @cmd: command descriptor to submit
*
* target_submit_prep or something similar must have been called on the cmd,
* and this must be called from process context.
*/
int transport_handle_cdb_direct(
struct se_cmd *cmd)
int target_submit(struct se_cmd *cmd)
{
sense_reason_t ret;

Expand Down Expand Up @@ -1640,7 +1642,7 @@ int transport_handle_cdb_direct(
transport_generic_request_failure(cmd, ret);
return 0;
}
EXPORT_SYMBOL(transport_handle_cdb_direct);
EXPORT_SYMBOL_GPL(target_submit);

sense_reason_t
transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl,
Expand Down Expand Up @@ -1807,19 +1809,6 @@ int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
}
EXPORT_SYMBOL_GPL(target_submit_prep);

/**
* target_submit - perform final initialization and submit cmd to LIO core
* @se_cmd: command descriptor to submit
*
* target_submit_prep must have been called on the cmd, and this must be
* called from process context.
*/
void target_submit(struct se_cmd *se_cmd)
{
transport_handle_cdb_direct(se_cmd);
}
EXPORT_SYMBOL_GPL(target_submit);

/**
* target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
*
Expand Down
3 changes: 1 addition & 2 deletions include/target/target_core_fabric.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
struct scatterlist *sgl, u32 sgl_count,
struct scatterlist *sgl_bidi, u32 sgl_bidi_count,
struct scatterlist *sgl_prot, u32 sgl_prot_count, gfp_t gfp);
void target_submit(struct se_cmd *se_cmd);
int target_submit(struct se_cmd *se_cmd);
sense_reason_t transport_lookup_cmd_lun(struct se_cmd *);
sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb,
gfp_t gfp);
Expand All @@ -188,7 +188,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
unsigned char *sense, u64 unpacked_lun,
void *fabric_tmr_ptr, unsigned char tm_type,
gfp_t, u64, int);
int transport_handle_cdb_direct(struct se_cmd *);
sense_reason_t transport_generic_new_cmd(struct se_cmd *);

void target_put_cmd_and_wait(struct se_cmd *cmd);
Expand Down

0 comments on commit 4289267

Please sign in to comment.