cfq-iosched: algebraic simplification in cfq_prio_to_maxrq()
authorNamhyung Kim <namhyung@gmail.com>
Tue, 24 May 2011 08:23:21 +0000 (10:23 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 24 May 2011 08:23:21 +0000 (10:23 +0200)
Simplify the calculation in cfq_prio_to_maxrq(), plus replace CFQ_PRIO_LISTS to
IOPRIO_BE_NR since they are the same and IOPRIO_BE_NR looks more reasonable in
this context IMHO.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/cfq-iosched.c

index 0316f6eece0383437cb63364d85b82e259c5eb8c..00763e510228da609b40a31fe882be781ccdca12 100644 (file)
@@ -2102,7 +2102,7 @@ cfq_prio_to_maxrq(struct cfq_data *cfqd, struct cfq_queue *cfqq)
 
        WARN_ON(cfqq->ioprio >= IOPRIO_BE_NR);
 
-       return 2 * (base_rq + base_rq * (CFQ_PRIO_LISTS - 1 - cfqq->ioprio));
+       return 2 * base_rq * (IOPRIO_BE_NR - cfqq->ioprio);
 }
 
 /*