Skip to content

Commit 4289267

Browse files
mikechristiemartinkpetersen
authored andcommitted
scsi: target: core: Kill transport_handle_cdb_direct()
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]>
1 parent 5c48a4e commit 4289267

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

drivers/target/iscsi/iscsi_target_erl1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ int iscsit_execute_cmd(struct iscsit_cmd *cmd, int ooo)
948948

949949
iscsit_set_unsolicited_dataout(cmd);
950950
}
951-
return transport_handle_cdb_direct(&cmd->se_cmd);
951+
return target_submit(&cmd->se_cmd);
952952

953953
case ISCSI_OP_NOOP_OUT:
954954
case ISCSI_OP_TEXT:

drivers/target/iscsi/iscsi_target_tmr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ static int iscsit_task_reassign_complete_read(
318318
pr_debug("READ ITT: 0x%08x: t_state: %d never sent to"
319319
" transport\n", cmd->init_task_tag,
320320
cmd->se_cmd.t_state);
321-
transport_handle_cdb_direct(se_cmd);
321+
target_submit(se_cmd);
322322
return 0;
323323
}
324324

drivers/target/target_core_transport.c

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,12 +1575,14 @@ target_cmd_parse_cdb(struct se_cmd *cmd)
15751575
}
15761576
EXPORT_SYMBOL(target_cmd_parse_cdb);
15771577

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

@@ -1640,7 +1642,7 @@ int transport_handle_cdb_direct(
16401642
transport_generic_request_failure(cmd, ret);
16411643
return 0;
16421644
}
1643-
EXPORT_SYMBOL(transport_handle_cdb_direct);
1645+
EXPORT_SYMBOL_GPL(target_submit);
16441646

16451647
sense_reason_t
16461648
transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl,
@@ -1807,19 +1809,6 @@ int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
18071809
}
18081810
EXPORT_SYMBOL_GPL(target_submit_prep);
18091811

1810-
/**
1811-
* target_submit - perform final initialization and submit cmd to LIO core
1812-
* @se_cmd: command descriptor to submit
1813-
*
1814-
* target_submit_prep must have been called on the cmd, and this must be
1815-
* called from process context.
1816-
*/
1817-
void target_submit(struct se_cmd *se_cmd)
1818-
{
1819-
transport_handle_cdb_direct(se_cmd);
1820-
}
1821-
EXPORT_SYMBOL_GPL(target_submit);
1822-
18231812
/**
18241813
* target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
18251814
*

include/target/target_core_fabric.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
175175
struct scatterlist *sgl, u32 sgl_count,
176176
struct scatterlist *sgl_bidi, u32 sgl_bidi_count,
177177
struct scatterlist *sgl_prot, u32 sgl_prot_count, gfp_t gfp);
178-
void target_submit(struct se_cmd *se_cmd);
178+
int target_submit(struct se_cmd *se_cmd);
179179
sense_reason_t transport_lookup_cmd_lun(struct se_cmd *);
180180
sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb,
181181
gfp_t gfp);
@@ -188,7 +188,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
188188
unsigned char *sense, u64 unpacked_lun,
189189
void *fabric_tmr_ptr, unsigned char tm_type,
190190
gfp_t, u64, int);
191-
int transport_handle_cdb_direct(struct se_cmd *);
192191
sense_reason_t transport_generic_new_cmd(struct se_cmd *);
193192

194193
void target_put_cmd_and_wait(struct se_cmd *cmd);

0 commit comments

Comments
 (0)