blk: Fix lock inversion between ioc lock and bfqd lock
[linux-2.6-microblaze.git] / block / blk-merge.c
index 4d97fb6..1398b52 100644 (file)
@@ -846,18 +846,15 @@ static struct request *attempt_front_merge(struct request_queue *q,
        return NULL;
 }
 
-int blk_attempt_req_merge(struct request_queue *q, struct request *rq,
-                         struct request *next)
+/*
+ * Try to merge 'next' into 'rq'. Return true if the merge happened, false
+ * otherwise. The caller is responsible for freeing 'next' if the merge
+ * happened.
+ */
+bool blk_attempt_req_merge(struct request_queue *q, struct request *rq,
+                          struct request *next)
 {
-       struct request *free;
-
-       free = attempt_merge(q, rq, next);
-       if (free) {
-               blk_put_request(free);
-               return 1;
-       }
-
-       return 0;
+       return attempt_merge(q, rq, next);
 }
 
 bool blk_rq_merge_ok(struct request *rq, struct bio *bio)