aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2021-02-06 22:46:04 -0600
committerMartin K. Petersen <martin.petersen@oracle.com>2021-02-08 22:39:04 -0500
commitb4046922b3c0740ad50a6e9c59e12f4dc43946d4 (patch)
treeebebb574b8725d5147859b3a5848ef46192908c1 /include/scsi
parentscsi: libiscsi: Fix iSCSI host workq destruction (diff)
downloadlinux-dev-b4046922b3c0740ad50a6e9c59e12f4dc43946d4.tar.xz
linux-dev-b4046922b3c0740ad50a6e9c59e12f4dc43946d4.zip
scsi: libiscsi: Add helper to calculate max SCSI cmds per session
This patch just breaks out the code that calculates the number of SCSI cmds that will be used for a SCSI session. It also adds a check that we don't go over the host's can_queue value. Link: https://lore.kernel.org/r/20210207044608.27585-6-michael.christie@oracle.com Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libiscsi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 44a9554aea62..02f966e9358f 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -395,6 +395,8 @@ extern struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
extern void iscsi_host_remove(struct Scsi_Host *shost);
extern void iscsi_host_free(struct Scsi_Host *shost);
extern int iscsi_target_alloc(struct scsi_target *starget);
+extern int iscsi_host_get_max_scsi_cmds(struct Scsi_Host *shost,
+ uint16_t requested_cmds_max);
/*
* session management