tree f00b0b3e4649ffcbcf1ff26c08ee28371a857c89
parent ffdfc40976dda18d923cd001d44bf0ee55da1af4
author Nikita Danilov <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:17:20 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:28 -0700

[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 <[EMAIL PROTECTED]>
Cc: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/block/deadline-iosched.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c
--- a/drivers/block/deadline-iosched.c
+++ b/drivers/block/deadline-iosched.c
@@ -507,18 +507,12 @@ static int deadline_dispatch_requests(st
        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(st
                        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;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to