From: Nikita Danilov Date: Tue, 6 Sep 2005 22:17:20 +0000 (-0700) Subject: [PATCH] cleanup of deadline_dispatch_requests() X-Git-Tag: v2.6.14-rc1~689 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4b0dc07e66ade18e0209331afbd16b3de8384f5c;p=linux-2.6-omap-h63xx.git [PATCH] cleanup of deadline_dispatch_requests() cleanup of deadline_dispatch_requests(): - replace drq selection with hopefully clearer while semantically the same construct: take write request, if there is any, otherwise take read one, or NULL if none exist. - kill unused other_dir. Signed-off-by: Nikita Danilov Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c index ff5201e0215..24594c57c32 100644 --- a/drivers/block/deadline-iosched.c +++ b/drivers/block/deadline-iosched.c @@ -507,18 +507,12 @@ static int deadline_dispatch_requests(struct deadline_data *dd) const int reads = !list_empty(&dd->fifo_list[READ]); const int writes = !list_empty(&dd->fifo_list[WRITE]); struct deadline_rq *drq; - int data_dir, other_dir; + int data_dir; /* * batches are currently reads XOR writes */ - drq = NULL; - - if (dd->next_drq[READ]) - drq = dd->next_drq[READ]; - - if (dd->next_drq[WRITE]) - drq = dd->next_drq[WRITE]; + drq = dd->next_drq[WRITE] ? : dd->next_drq[READ]; if (drq) { /* we have a "next request" */ @@ -544,7 +538,6 @@ static int deadline_dispatch_requests(struct deadline_data *dd) goto dispatch_writes; data_dir = READ; - other_dir = WRITE; goto dispatch_find_request; } @@ -560,7 +553,6 @@ dispatch_writes: dd->starved = 0; data_dir = WRITE; - other_dir = READ; goto dispatch_find_request; }