Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146970
b: refs/heads/master
c: a538cd0
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Apr 28, 2009
1 parent b5f6ab7 commit a9e9ab2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 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: db2dbb12dc47a50c7a4c5678f526014063e486f6
refs/heads/master: a538cd03be6f363d039daa94199c28cfbd508455
35 changes: 14 additions & 21 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,24 +333,6 @@ void blk_unplug(struct request_queue *q)
}
EXPORT_SYMBOL(blk_unplug);

static void blk_invoke_request_fn(struct request_queue *q)
{
if (unlikely(blk_queue_stopped(q)))
return;

/*
* one level of recursion is ok and is much faster than kicking
* the unplug handling
*/
if (!queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) {
q->request_fn(q);
queue_flag_clear(QUEUE_FLAG_REENTER, q);
} else {
queue_flag_set(QUEUE_FLAG_PLUGGED, q);
kblockd_schedule_work(q, &q->unplug_work);
}
}

/**
* blk_start_queue - restart a previously stopped queue
* @q: The &struct request_queue in question
Expand All @@ -365,7 +347,7 @@ void blk_start_queue(struct request_queue *q)
WARN_ON(!irqs_disabled());

queue_flag_clear(QUEUE_FLAG_STOPPED, q);
blk_invoke_request_fn(q);
__blk_run_queue(q);
}
EXPORT_SYMBOL(blk_start_queue);

Expand Down Expand Up @@ -425,12 +407,23 @@ void __blk_run_queue(struct request_queue *q)
{
blk_remove_plug(q);

if (unlikely(blk_queue_stopped(q)))
return;

if (elv_queue_empty(q))
return;

/*
* Only recurse once to avoid overrunning the stack, let the unplug
* handling reinvoke the handler shortly if we already got there.
*/
if (!elv_queue_empty(q))
blk_invoke_request_fn(q);
if (!queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) {
q->request_fn(q);
queue_flag_clear(QUEUE_FLAG_REENTER, q);
} else {
queue_flag_set(QUEUE_FLAG_PLUGGED, q);
kblockd_schedule_work(q, &q->unplug_work);
}
}
EXPORT_SYMBOL(__blk_run_queue);

Expand Down

0 comments on commit a9e9ab2

Please sign in to comment.