Skip to content

Commit ee48345

Browse files
mikechristiemartinkpetersen
authored andcommitted
scsi: target: core: Move core_alua_check_nonop_delay() call
Move core_alua_check_nonop_delay() to transport_handle_cdb_direct() so the iSCSI target driver doesn't have to call as many core functions directly. We will eventually merge transport_handle_cdb_direct and target_submit so iSCSI and the other drivers call a common function. It will also be helpful as preparation for future changes which allow the iSCSI target to defer command submission to the LIO submission workqueue, because we will have a common submission function for that which will be based on transport_handle_cdb_direct()/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 194605d commit ee48345

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

drivers/target/iscsi/iscsi_target.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,12 +1234,6 @@ int iscsit_setup_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd,
12341234
spin_lock_bh(&conn->cmd_lock);
12351235
list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
12361236
spin_unlock_bh(&conn->cmd_lock);
1237-
/*
1238-
* Check if we need to delay processing because of ALUA
1239-
* Active/NonOptimized primary access state..
1240-
*/
1241-
core_alua_check_nonop_delay(&cmd->se_cmd);
1242-
12431237
return 0;
12441238
}
12451239
EXPORT_SYMBOL(iscsit_setup_scsi_cmd);

drivers/target/target_core_alua.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,6 @@ int core_alua_check_nonop_delay(
850850
msleep_interruptible(cmd->alua_nonop_delay);
851851
return 0;
852852
}
853-
EXPORT_SYMBOL(core_alua_check_nonop_delay);
854853

855854
static int core_alua_write_tpg_metadata(
856855
const char *path,

drivers/target/target_core_transport.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,12 @@ int transport_handle_cdb_direct(
15861586

15871587
might_sleep();
15881588

1589+
/*
1590+
* Check if we need to delay processing because of ALUA
1591+
* Active/NonOptimized primary access state..
1592+
*/
1593+
core_alua_check_nonop_delay(cmd);
1594+
15891595
if (!cmd->se_lun) {
15901596
dump_stack();
15911597
pr_err("cmd->se_lun is NULL\n");
@@ -1817,12 +1823,6 @@ void target_submit(struct se_cmd *se_cmd)
18171823

18181824
}
18191825

1820-
/*
1821-
* Check if we need to delay processing because of ALUA
1822-
* Active/NonOptimized primary access state..
1823-
*/
1824-
core_alua_check_nonop_delay(se_cmd);
1825-
18261826
transport_handle_cdb_direct(se_cmd);
18271827
}
18281828
EXPORT_SYMBOL_GPL(target_submit);

include/target/target_core_fabric.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ void target_stop_session(struct se_session *se_sess);
206206
void target_wait_for_sess_cmds(struct se_session *);
207207
void target_show_cmd(const char *pfx, struct se_cmd *cmd);
208208

209-
int core_alua_check_nonop_delay(struct se_cmd *);
210-
211209
int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
212210
void core_tmr_release_req(struct se_tmr_req *);
213211
int transport_generic_handle_tmr(struct se_cmd *);

0 commit comments

Comments
 (0)