git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tty: const: constify remaining tty_operations
[safe/jmp/linux-2.6]
/
block
/
blk-tag.c
diff --git
a/block/blk-tag.c
b/block/blk-tag.c
index
c260f7c
..
6b0f52c
100644
(file)
--- a/
block/blk-tag.c
+++ b/
block/blk-tag.c
@@
-336,7
+336,7
@@
EXPORT_SYMBOL(blk_queue_end_tag);
int blk_queue_start_tag(struct request_queue *q, struct request *rq)
{
struct blk_queue_tag *bqt = q->queue_tags;
int blk_queue_start_tag(struct request_queue *q, struct request *rq)
{
struct blk_queue_tag *bqt = q->queue_tags;
- unsigned max_depth
, offset
;
+ unsigned max_depth;
int tag;
if (unlikely((rq->cmd_flags & REQ_QUEUED))) {
int tag;
if (unlikely((rq->cmd_flags & REQ_QUEUED))) {
@@
-355,13
+355,16
@@
int blk_queue_start_tag(struct request_queue *q, struct request *rq)
* to starve sync IO on behalf of flooding async IO.
*/
max_depth = bqt->max_depth;
* to starve sync IO on behalf of flooding async IO.
*/
max_depth = bqt->max_depth;
- if (rq_is_sync(rq))
- offset = 0;
- else
- offset = max_depth >> 2;
+ if (!rq_is_sync(rq) && max_depth > 1) {
+ max_depth -= 2;
+ if (!max_depth)
+ max_depth = 1;
+ if (q->in_flight[BLK_RW_ASYNC] > max_depth)
+ return 1;
+ }
do {
do {
- tag = find_
next_zero_bit(bqt->tag_map, max_depth, offset
);
+ tag = find_
first_zero_bit(bqt->tag_map, max_depth
);
if (tag >= max_depth)
return 1;
if (tag >= max_depth)
return 1;