Skip to content

Commit

Permalink
scsi: target: core: Move core_alua_check_nonop_delay() call
Browse files Browse the repository at this point in the history
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 <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20230928020907.5730-3-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Mike Christie authored and Martin K. Petersen committed Oct 13, 2023
1 parent 194605d commit ee48345
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
6 changes: 0 additions & 6 deletions drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,12 +1234,6 @@ int iscsit_setup_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd,
spin_lock_bh(&conn->cmd_lock);
list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
spin_unlock_bh(&conn->cmd_lock);
/*
* Check if we need to delay processing because of ALUA
* Active/NonOptimized primary access state..
*/
core_alua_check_nonop_delay(&cmd->se_cmd);

return 0;
}
EXPORT_SYMBOL(iscsit_setup_scsi_cmd);
Expand Down
1 change: 0 additions & 1 deletion drivers/target/target_core_alua.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,6 @@ int core_alua_check_nonop_delay(
msleep_interruptible(cmd->alua_nonop_delay);
return 0;
}
EXPORT_SYMBOL(core_alua_check_nonop_delay);

static int core_alua_write_tpg_metadata(
const char *path,
Expand Down
12 changes: 6 additions & 6 deletions drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,12 @@ int transport_handle_cdb_direct(

might_sleep();

/*
* Check if we need to delay processing because of ALUA
* Active/NonOptimized primary access state..
*/
core_alua_check_nonop_delay(cmd);

if (!cmd->se_lun) {
dump_stack();
pr_err("cmd->se_lun is NULL\n");
Expand Down Expand Up @@ -1817,12 +1823,6 @@ void target_submit(struct se_cmd *se_cmd)

}

/*
* Check if we need to delay processing because of ALUA
* Active/NonOptimized primary access state..
*/
core_alua_check_nonop_delay(se_cmd);

transport_handle_cdb_direct(se_cmd);
}
EXPORT_SYMBOL_GPL(target_submit);
Expand Down
2 changes: 0 additions & 2 deletions include/target/target_core_fabric.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ void target_stop_session(struct se_session *se_sess);
void target_wait_for_sess_cmds(struct se_session *);
void target_show_cmd(const char *pfx, struct se_cmd *cmd);

int core_alua_check_nonop_delay(struct se_cmd *);

int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
void core_tmr_release_req(struct se_tmr_req *);
int transport_generic_handle_tmr(struct se_cmd *);
Expand Down

0 comments on commit ee48345

Please sign in to comment.