diff options
Diffstat (limited to 'drivers/block/noop-iosched.c')
-rw-r--r-- | drivers/block/noop-iosched.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/drivers/block/noop-iosched.c b/drivers/block/noop-iosched.c index 888c477e02b3..b1730b62c37e 100644 --- a/drivers/block/noop-iosched.c +++ b/drivers/block/noop-iosched.c | |||
@@ -13,34 +13,13 @@ | |||
13 | static int elevator_noop_merge(request_queue_t *q, struct request **req, | 13 | static int elevator_noop_merge(request_queue_t *q, struct request **req, |
14 | struct bio *bio) | 14 | struct bio *bio) |
15 | { | 15 | { |
16 | struct list_head *entry = &q->queue_head; | ||
17 | struct request *__rq; | ||
18 | int ret; | 16 | int ret; |
19 | 17 | ||
20 | if ((ret = elv_try_last_merge(q, bio))) { | 18 | ret = elv_try_last_merge(q, bio); |
19 | if (ret != ELEVATOR_NO_MERGE) | ||
21 | *req = q->last_merge; | 20 | *req = q->last_merge; |
22 | return ret; | ||
23 | } | ||
24 | 21 | ||
25 | while ((entry = entry->prev) != &q->queue_head) { | 22 | return ret; |
26 | __rq = list_entry_rq(entry); | ||
27 | |||
28 | if (__rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) | ||
29 | break; | ||
30 | else if (__rq->flags & REQ_STARTED) | ||
31 | break; | ||
32 | |||
33 | if (!blk_fs_request(__rq)) | ||
34 | continue; | ||
35 | |||
36 | if ((ret = elv_try_merge(__rq, bio))) { | ||
37 | *req = __rq; | ||
38 | q->last_merge = __rq; | ||
39 | return ret; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | return ELEVATOR_NO_MERGE; | ||
44 | } | 23 | } |
45 | 24 | ||
46 | static void elevator_noop_merge_requests(request_queue_t *q, struct request *req, | 25 | static void elevator_noop_merge_requests(request_queue_t *q, struct request *req, |