scsi: libiscsi: Add helper to calculate max SCSI cmds per session
authorMike Christie <michael.christie@oracle.com>
Sun, 7 Feb 2021 04:46:04 +0000 (22:46 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Feb 2021 03:39:04 +0000 (22:39 -0500)
commitb4046922b3c0740ad50a6e9c59e12f4dc43946d4
treeebebb574b8725d5147859b3a5848ef46192908c1
parentc435f0a9ecb7435e70f447b7231ca52de589b252
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>
drivers/scsi/libiscsi.c
include/scsi/libiscsi.h