Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345663
b: refs/heads/master
c: bee0393
h: refs/heads/master
i:
  345661: b3e1520
  345659: f68891b
  345655: 571dde4
  345647: e1a113f
  345631: bb62c21
  345599: aaac4fa
v: v3
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Nov 9, 2012
1 parent 10773e0 commit 6245e8e
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: 3d106fba2e7eb6967b1e2cc147a6894ec4307cef
refs/heads/master: bee0393cc12b6d8f10e884e555a095e050e0b2b9
16 changes: 12 additions & 4 deletions trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,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 @@ -471,14 +472,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 6245e8e

Please sign in to comment.