提交 4b0dc07e 编写于 作者: N Nikita Danilov 提交者: Linus Torvalds

[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: NNikita Danilov <nikita@clusterfs.com>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 ffdfc409
...@@ -507,18 +507,12 @@ static int deadline_dispatch_requests(struct deadline_data *dd) ...@@ -507,18 +507,12 @@ static int deadline_dispatch_requests(struct deadline_data *dd)
const int reads = !list_empty(&dd->fifo_list[READ]); const int reads = !list_empty(&dd->fifo_list[READ]);
const int writes = !list_empty(&dd->fifo_list[WRITE]); const int writes = !list_empty(&dd->fifo_list[WRITE]);
struct deadline_rq *drq; struct deadline_rq *drq;
int data_dir, other_dir; int data_dir;
/* /*
* batches are currently reads XOR writes * batches are currently reads XOR writes
*/ */
drq = NULL; drq = dd->next_drq[WRITE] ? : dd->next_drq[READ];
if (dd->next_drq[READ])
drq = dd->next_drq[READ];
if (dd->next_drq[WRITE])
drq = dd->next_drq[WRITE];
if (drq) { if (drq) {
/* we have a "next request" */ /* we have a "next request" */
...@@ -544,7 +538,6 @@ static int deadline_dispatch_requests(struct deadline_data *dd) ...@@ -544,7 +538,6 @@ static int deadline_dispatch_requests(struct deadline_data *dd)
goto dispatch_writes; goto dispatch_writes;
data_dir = READ; data_dir = READ;
other_dir = WRITE;
goto dispatch_find_request; goto dispatch_find_request;
} }
...@@ -560,7 +553,6 @@ static int deadline_dispatch_requests(struct deadline_data *dd) ...@@ -560,7 +553,6 @@ static int deadline_dispatch_requests(struct deadline_data *dd)
dd->starved = 0; dd->starved = 0;
data_dir = WRITE; data_dir = WRITE;
other_dir = READ;
goto dispatch_find_request; goto dispatch_find_request;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册