Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44930
b: refs/heads/master
c: f2a67a5
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Dec 22, 2006
1 parent e85017f commit 7ae801c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 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: 5c668704b7fa5a4ebf21a490ddfbd6dc2e01fc97
refs/heads/master: f2a67a576959025549a3b6a884bdd21f4dc107da
21 changes: 8 additions & 13 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,25 +577,20 @@ static int cfq_allow_merge(request_queue_t *q, struct request *rq,
pid_t key;

/*
* If bio is async or a write, always allow merge
* Disallow merge, if bio and rq aren't both sync or async
*/
if (!bio_sync(bio) || rw == WRITE)
return 1;

/*
* bio is sync. if request is not, disallow.
*/
if (!rq_is_sync(rq))
if (!!bio_sync(bio) != !!rq_is_sync(rq))
return 0;

/*
* Ok, both bio and request are sync. Allow merge if they are
* from the same queue.
* Lookup the cfqq that this bio will be queued with. Allow
* merge only if rq is queued there.
*/
key = cfq_queue_pid(current, rw, 1);
key = cfq_queue_pid(current, rw, bio_sync(bio));
cfqq = cfq_find_cfq_hash(cfqd, key, current->ioprio);
if (cfqq != RQ_CFQQ(rq))
return 0;

if (cfqq == RQ_CFQQ(rq))
return 1;

return 1;
}
Expand Down

0 comments on commit 7ae801c

Please sign in to comment.