summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_transport.c
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2023-03-19 04:56:15 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2023-03-25 00:32:23 +0300
commit6d256bee602b131bd4fbc92863b6a1210bcf6325 (patch)
treebf88ed77e94ca2ffb23210cefdb644245c7dae87 /drivers/target/target_core_transport.c
parent8e288be8606ad87c1726618eacfb8fbd3ab4b806 (diff)
downloadlinux-6d256bee602b131bd4fbc92863b6a1210bcf6325.tar.xz
scsi: target: iscsit: isert: Alloc per conn cmd counter
This has iscsit allocate a per conn cmd counter and converts iscsit/isert to use it instead of the per session one. Signed-off-by: Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-5-michael.christie@oracle.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_transport.c')
-rw-r--r--drivers/target/target_core_transport.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index c395606ab1a9..86adff2a86ed 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -254,7 +254,7 @@ free_cmd_cnt:
}
EXPORT_SYMBOL_GPL(target_alloc_cmd_counter);
-static void target_free_cmd_counter(struct target_cmd_counter *cmd_cnt)
+void target_free_cmd_counter(struct target_cmd_counter *cmd_cnt)
{
/*
* Drivers like loop do not call target_stop_session during session
@@ -265,6 +265,7 @@ static void target_free_cmd_counter(struct target_cmd_counter *cmd_cnt)
percpu_ref_exit(&cmd_cnt->refcnt);
}
+EXPORT_SYMBOL_GPL(target_free_cmd_counter);
/**
* transport_init_session - initialize a session object
@@ -3170,13 +3171,14 @@ static void target_stop_cmd_counter_confirm(struct percpu_ref *ref)
* target_stop_cmd_counter - Stop new IO from being added to the counter.
* @cmd_cnt: counter to stop
*/
-static void target_stop_cmd_counter(struct target_cmd_counter *cmd_cnt)
+void target_stop_cmd_counter(struct target_cmd_counter *cmd_cnt)
{
pr_debug("Stopping command counter.\n");
if (!atomic_cmpxchg(&cmd_cnt->stopped, 0, 1))
percpu_ref_kill_and_confirm(&cmd_cnt->refcnt,
target_stop_cmd_counter_confirm);
}
+EXPORT_SYMBOL_GPL(target_stop_cmd_counter);
/**
* target_stop_session - Stop new IO from being queued on the session.
@@ -3192,7 +3194,7 @@ EXPORT_SYMBOL(target_stop_session);
* target_wait_for_cmds - Wait for outstanding cmds.
* @cmd_cnt: counter to wait for active I/O for.
*/
-static void target_wait_for_cmds(struct target_cmd_counter *cmd_cnt)
+void target_wait_for_cmds(struct target_cmd_counter *cmd_cnt)
{
int ret;
@@ -3208,6 +3210,7 @@ static void target_wait_for_cmds(struct target_cmd_counter *cmd_cnt)
wait_for_completion(&cmd_cnt->stop_done);
pr_debug("Waiting for cmds done.\n");
}
+EXPORT_SYMBOL_GPL(target_wait_for_cmds);
/**
* target_wait_for_sess_cmds - Wait for outstanding commands