diff options
author | Nikita Danilov <nikita@clusterfs.com> | 2005-09-06 18:17:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:28 -0400 |
commit | 4b0dc07e66ade18e0209331afbd16b3de8384f5c (patch) | |
tree | f00b0b3e4649ffcbcf1ff26c08ee28371a857c89 /drivers/block/deadline-iosched.c | |
parent | ffdfc40976dda18d923cd001d44bf0ee55da1af4 (diff) |
[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 <nikita@clusterfs.com>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/deadline-iosched.c')
-rw-r--r-- | 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 index ff5201e02153..24594c57c323 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) | |||
507 | const int reads = !list_empty(&dd->fifo_list[READ]); | 507 | const int reads = !list_empty(&dd->fifo_list[READ]); |
508 | const int writes = !list_empty(&dd->fifo_list[WRITE]); | 508 | const int writes = !list_empty(&dd->fifo_list[WRITE]); |
509 | struct deadline_rq *drq; | 509 | struct deadline_rq *drq; |
510 | int data_dir, other_dir; | 510 | int data_dir; |
511 | 511 | ||
512 | /* | 512 | /* |
513 | * batches are currently reads XOR writes | 513 | * batches are currently reads XOR writes |
514 | */ | 514 | */ |
515 | drq = NULL; | 515 | drq = dd->next_drq[WRITE] ? : dd->next_drq[READ]; |
516 | |||
517 | if (dd->next_drq[READ]) | ||
518 | drq = dd->next_drq[READ]; | ||
519 | |||
520 | if (dd->next_drq[WRITE]) | ||
521 | drq = dd->next_drq[WRITE]; | ||
522 | 516 | ||
523 | if (drq) { | 517 | if (drq) { |
524 | /* we have a "next request" */ | 518 | /* we have a "next request" */ |
@@ -544,7 +538,6 @@ static int deadline_dispatch_requests(struct deadline_data *dd) | |||
544 | goto dispatch_writes; | 538 | goto dispatch_writes; |
545 | 539 | ||
546 | data_dir = READ; | 540 | data_dir = READ; |
547 | other_dir = WRITE; | ||
548 | 541 | ||
549 | goto dispatch_find_request; | 542 | goto dispatch_find_request; |
550 | } | 543 | } |
@@ -560,7 +553,6 @@ dispatch_writes: | |||
560 | dd->starved = 0; | 553 | dd->starved = 0; |
561 | 554 | ||
562 | data_dir = WRITE; | 555 | data_dir = WRITE; |
563 | other_dir = READ; | ||
564 | 556 | ||
565 | goto dispatch_find_request; | 557 | goto dispatch_find_request; |
566 | } | 558 | } |