Commit 2f295bea authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe

block/mq-deadline: Remove two local variables

Make __dd_dispatch_request() easier to read by removing two local
variables.
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20210618004456.7280-8-bvanassche@acm.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3bd473f4
......@@ -276,7 +276,6 @@ deadline_next_request(struct deadline_data *dd, int data_dir)
static struct request *__dd_dispatch_request(struct deadline_data *dd)
{
struct request *rq, *next_rq;
bool reads, writes;
int data_dir;
lockdep_assert_held(&dd->lock);
......@@ -287,9 +286,6 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd)
goto done;
}
reads = !list_empty(&dd->fifo_list[READ]);
writes = !list_empty(&dd->fifo_list[WRITE]);
/*
* batches are currently reads XOR writes
*/
......@@ -306,7 +302,7 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd)
* data direction (read / write)
*/
if (reads) {
if (!list_empty(&dd->fifo_list[READ])) {
BUG_ON(RB_EMPTY_ROOT(&dd->sort_list[READ]));
if (deadline_fifo_request(dd, WRITE) &&
......@@ -322,7 +318,7 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd)
* there are either no reads or writes have been starved
*/
if (writes) {
if (!list_empty(&dd->fifo_list[WRITE])) {
dispatch_writes:
BUG_ON(RB_EMPTY_ROOT(&dd->sort_list[WRITE]));
......
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