|
@@ -348,9 +348,16 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
|
|
*/
|
|
*/
|
|
max_depth = bqt->max_depth;
|
|
max_depth = bqt->max_depth;
|
|
if (!rq_is_sync(rq) && max_depth > 1) {
|
|
if (!rq_is_sync(rq) && max_depth > 1) {
|
|
- max_depth -= 2;
|
|
|
|
- if (!max_depth)
|
|
|
|
|
|
+ switch (max_depth) {
|
|
|
|
+ case 2:
|
|
max_depth = 1;
|
|
max_depth = 1;
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ max_depth = 2;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ max_depth -= 2;
|
|
|
|
+ }
|
|
if (q->in_flight[BLK_RW_ASYNC] > max_depth)
|
|
if (q->in_flight[BLK_RW_ASYNC] > max_depth)
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|