Skip to content

Commit

Permalink
cfq-iosched: algebraic simplification in cfq_prio_to_maxrq()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Namhyung Kim authored and Jens Axboe committed May 24, 2011
1 parent 4cbadbd commit b9f8ce0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit b9f8ce0

Please sign in to comment.