block/genhd.c: remove useless cast in diskstats_show()
[linux-2.6.git] / block / deadline-iosched.c
index fd31117..c644137 100644 (file)
@@ -77,10 +77,8 @@ static void
 deadline_add_rq_rb(struct deadline_data *dd, struct request *rq)
 {
        struct rb_root *root = deadline_rb_root(dd, rq);
-       struct request *__alias;
 
-       while (unlikely(__alias = elv_rb_add(root, rq)))
-               deadline_move_request(dd, __alias);
+       elv_rb_add(root, rq);
 }
 
 static inline void
@@ -138,7 +136,7 @@ deadline_merge(struct request_queue *q, struct request **req, struct bio *bio)
 
                __rq = elv_rb_find(&dd->sort_list[bio_data_dir(bio)], sector);
                if (__rq) {
-                       BUG_ON(sector != __rq->sector);
+                       BUG_ON(sector != blk_rq_pos(__rq));
 
                        if (elv_rq_merge_ok(__rq, bio)) {
                                ret = ELEVATOR_FRONT_MERGE;
@@ -326,15 +324,7 @@ dispatch_request:
        return 1;
 }
 
-static int deadline_queue_empty(struct request_queue *q)
-{
-       struct deadline_data *dd = q->elevator->elevator_data;
-
-       return list_empty(&dd->fifo_list[WRITE])
-               && list_empty(&dd->fifo_list[READ]);
-}
-
-static void deadline_exit_queue(elevator_t *e)
+static void deadline_exit_queue(struct elevator_queue *e)
 {
        struct deadline_data *dd = e->elevator_data;
 
@@ -387,7 +377,7 @@ deadline_var_store(int *var, const char *page, size_t count)
 }
 
 #define SHOW_FUNCTION(__FUNC, __VAR, __CONV)                           \
-static ssize_t __FUNC(elevator_t *e, char *page)                       \
+static ssize_t __FUNC(struct elevator_queue *e, char *page)            \
 {                                                                      \
        struct deadline_data *dd = e->elevator_data;                    \
        int __data = __VAR;                                             \
@@ -403,7 +393,7 @@ SHOW_FUNCTION(deadline_fifo_batch_show, dd->fifo_batch, 0);
 #undef SHOW_FUNCTION
 
 #define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV)                        \
-static ssize_t __FUNC(elevator_t *e, const char *page, size_t count)   \
+static ssize_t __FUNC(struct elevator_queue *e, const char *page, size_t count)        \
 {                                                                      \
        struct deadline_data *dd = e->elevator_data;                    \
        int __data;                                                     \
@@ -445,7 +435,6 @@ static struct elevator_type iosched_deadline = {
                .elevator_merge_req_fn =        deadline_merged_requests,
                .elevator_dispatch_fn =         deadline_dispatch_requests,
                .elevator_add_req_fn =          deadline_add_request,
-               .elevator_queue_empty_fn =      deadline_queue_empty,
                .elevator_former_req_fn =       elv_rb_former_request,
                .elevator_latter_req_fn =       elv_rb_latter_request,
                .elevator_init_fn =             deadline_init_queue,