Commit 267033f6 authored by James Bottomley's avatar James Bottomley

move queue_depth check from scsi_prep_fn to scsi_request_fn

parent 79e99219
......@@ -814,8 +814,6 @@ int scsi_prep_fn(struct request_queue *q, struct request *req)
SRpnt = (Scsi_Request *) req->special;
if (SRpnt->sr_magic == SCSI_REQ_MAGIC) {
if (SDpnt->device_busy >= SDpnt->queue_depth)
return BLKPREP_DEFER;
SCpnt = scsi_get_command(SRpnt->sr_device, GFP_ATOMIC);
if (!SCpnt)
return BLKPREP_DEFER;
......@@ -827,8 +825,6 @@ int scsi_prep_fn(struct request_queue *q, struct request *req)
* Now try and find a command block that we can use.
*/
if (!req->special) {
if (SDpnt->device_busy >= SDpnt->queue_depth)
return BLKPREP_DEFER;
SCpnt = scsi_get_command(SDpnt, GFP_ATOMIC);
if (unlikely(!SCpnt))
return BLKPREP_DEFER;
......@@ -951,6 +947,9 @@ void scsi_request_fn(request_queue_t * q)
*/
req = elv_next_request(q);
if (SDpnt->device_busy >= SDpnt->queue_depth)
break;
if(SHpnt->host_busy == 0 && SHpnt->host_blocked) {
/* unblock after host_blocked iterates to zero */
if(--SHpnt->host_blocked == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment