]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - drivers/block/noop-iosched.c
[PATCH] noop-iosched: kill O(N) merge scan
[linux-3.10.git] / drivers / block / noop-iosched.c
index 888c477e02b314b75b0b06d3658b784bc7cf9d28..b1730b62c37e4793a2401df975680c1231903d16 100644 (file)
 static int elevator_noop_merge(request_queue_t *q, struct request **req,
                               struct bio *bio)
 {
-       struct list_head *entry = &q->queue_head;
-       struct request *__rq;
        int ret;
 
-       if ((ret = elv_try_last_merge(q, bio))) {
+       ret = elv_try_last_merge(q, bio);
+       if (ret != ELEVATOR_NO_MERGE)
                *req = q->last_merge;
-               return ret;
-       }
 
-       while ((entry = entry->prev) != &q->queue_head) {
-               __rq = list_entry_rq(entry);
-
-               if (__rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER))
-                       break;
-               else if (__rq->flags & REQ_STARTED)
-                       break;
-
-               if (!blk_fs_request(__rq))
-                       continue;
-
-               if ((ret = elv_try_merge(__rq, bio))) {
-                       *req = __rq;
-                       q->last_merge = __rq;
-                       return ret;
-               }
-       }
-
-       return ELEVATOR_NO_MERGE;
+       return ret;
 }
 
 static void elevator_noop_merge_requests(request_queue_t *q, struct request *req,