FROMGIT: block/mq-deadline: Remove two local variables
Make __dd_dispatch_request() easier to read by removing two local variables. Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Himanshu 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: Bart Van Assche <bvanassche@acm.org> BUG: 187357408 Change-Id: I5567f7d02a2c628efb437058a1c103c7b123747a (cherry picked from commit f005b6ff19d2a961a2c3ae9c5f49d48fda143469 git://git.kernel.dk/linux-block/ for-5.14/block) Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Todd Kjos
parent
d0d50fe4b4
commit
4c5a1f31b3
@@ -274,7 +274,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);
|
||||
@@ -285,9 +284,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
|
||||
*/
|
||||
@@ -304,7 +300,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) &&
|
||||
@@ -320,7 +316,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]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user