iscsi-target: move iscsit_thread_check_cpumask()

Move iscsit_thread_check_cpumask() to header
file so that ISCSI_HW_OFFLOAD and other transport drivers
can call this function to ensure both tx and rx thread
runs on same cpu.

Signed-off-by: Varun Prakash <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
Varun Prakash 2016-04-20 00:00:14 +05:30 • committed by Nicholas Bellinger
commit c0b7373be8
2 changed files with 26 additions and 26 deletions

View file

@ -3580,32 +3580,6 @@ void iscsit_thread_get_cpumask(struct iscsi_conn *conn)
cpumask_setall(conn->conn_cpumask);
}
static inline void iscsit_thread_check_cpumask(
struct iscsi_conn *conn,
struct task_struct *p,
int mode)
{
/*
* mode == 1 signals iscsi_target_tx_thread() usage.
* mode == 0 signals iscsi_target_rx_thread() usage.
*/
if (mode == 1) {
if (!conn->conn_tx_reset_cpumask)
return;
conn->conn_tx_reset_cpumask = 0;
} else {
if (!conn->conn_rx_reset_cpumask)
return;
conn->conn_rx_reset_cpumask = 0;
}
/*
* Update the CPU mask for this single kthread so that
* both TX and RX kthreads are scheduled to run on the
* same CPU.
*/
set_cpus_allowed_ptr(p, conn->conn_cpumask);
}
static int
iscsit_immediate_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state)
{