Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285120
b: refs/heads/master
c: 2741932
h: refs/heads/master
v: v3
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Dec 16, 2011
1 parent a467fa9 commit 3579caf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a0b75c7d02c2bd46ed227d4ba5941ba8a0aba5d
refs/heads/master: 274193224cdabd687d804a26e0150bb20f2dd52c
16 changes: 12 additions & 4 deletions trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ static bool elv_attempt_insert_merge(struct request_queue *q,
struct request *rq)
{
struct request *__rq;
bool ret;

if (blk_queue_nomerges(q))
return false;
Expand All @@ -528,14 +529,21 @@ static bool elv_attempt_insert_merge(struct request_queue *q,
if (blk_queue_noxmerges(q))
return false;

ret = false;
/*
* See if our hash lookup can find a potential backmerge.
*/
__rq = elv_rqhash_find(q, blk_rq_pos(rq));
if (__rq && blk_attempt_req_merge(q, __rq, rq))
return true;
while (1) {
__rq = elv_rqhash_find(q, blk_rq_pos(rq));
if (!__rq || !blk_attempt_req_merge(q, __rq, rq))
break;

return false;
/* The merged request could be merged with others, try again */
ret = true;
rq = __rq;
}

return ret;
}

void elv_merged_request(struct request_queue *q, struct request *rq, int type)
Expand Down

0 comments on commit 3579caf

Please sign in to comment.