aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-13 14:27:41 +0100
committerChristoph Hellwig <hch@lst.de>2014-11-24 14:45:26 +0100
commit1e6f2416044c062a56091ebf8d76760956dd5872 (patch)
tree53b83ab97cc475c37f957bb85167ae8cb2ccd550 /drivers/infiniband/ulp/srp
parentscsi: avoid ->change_queue_depth indirection for queue full tracking (diff)
downloadlinux-dev-1e6f2416044c062a56091ebf8d76760956dd5872.tar.xz
linux-dev-1e6f2416044c062a56091ebf8d76760956dd5872.zip
scsi: don't allow setting of queue_depth bigger than can_queue
We won't ever queue more commands than the host allows. Instead of letting drivers either reject or ignore this case handle it in common code. Note that various driver use internal constant or variables that are assigned to both shost->can_queue and checked in ->change_queue_depth - I did remove those checks as well. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/infiniband/ulp/srp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 98a303558930..8d13a19e04b2 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2410,14 +2410,8 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
static int
srp_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
{
- struct Scsi_Host *shost = sdev->host;
- int max_depth;
-
- max_depth = shost->can_queue;
if (!sdev->tagged_supported)
- max_depth = 1;
- if (qdepth > max_depth)
- qdepth = max_depth;
+ qdepth = 1;
scsi_adjust_queue_depth(sdev, qdepth);
return sdev->queue_depth;
}