Add a macro for the max queue depth which is supported.
Signed-off-by: John Garry <[email protected]>
---
drivers/scsi/scsi.c | 2 +-
drivers/scsi/scsi_priv.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 76cdad063f7bc..28c9bbf439db6 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -204,7 +204,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
*/
int scsi_device_max_queue_depth(struct scsi_device *sdev)
{
- return min_t(int, sdev->host->can_queue, 4096);
+ return min_t(int, sdev->host->can_queue, SCSI_MAX_QUEUE_DEPTH);
}
/**
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index d07ec15d6c002..679752c5f8bba 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -18,6 +18,8 @@ struct scsi_nl_hdr;
#define SCSI_CMD_RETRIES_NO_LIMIT -1
+#define SCSI_MAX_QUEUE_DEPTH 4096
+
/*
* Error codes used by scsi-ml internally. These must not be used by drivers.
*/
--
2.43.5