Commit 15283e97 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] documentation and tq_disk removals

This should be the last of tq_disk, at least the trivial ones. md still
has some queue_task references, I'll let Ingo/Neil clean those up.
suspend is still broken, it was broken before too though. I guess Pavel
will want to fix that.

Also, I've documented the plug functions.
parent 6e7c72aa
......@@ -848,9 +848,15 @@ void generic_unplug_device(void *data)
spin_unlock_irqrestore(q->queue_lock, flags);
}
/*
* clear stop flag and run queue
*/
/**
* blk_start_queue - restart a previously stopped queue
* @q: The &request_queue_t in question
*
* Description:
* blk_start_queue() will clear the stop flag on the queue, and call
* the request_fn for the queue if it was in a stopped state when
* entered. Also see blk_stop_queue()
**/
void blk_start_queue(request_queue_t *q)
{
if (test_and_clear_bit(QUEUE_FLAG_STOPPED, &q->queue_flags)) {
......@@ -863,17 +869,33 @@ void blk_start_queue(request_queue_t *q)
}
}
/*
* set stop bit, queue won't be run until blk_start_queue() is called
*/
/**
* blk_stop_queue - stop a queue
* @q: The &request_queue_t in question
*
* Description:
* The Linux block layer assumes that a block driver will consume all
* entries on the request queue when the request_fn strategy is called.
* Often this will not happen, because of hardware limitations (queue
* depth settings). If a device driver gets a 'queue full' response,
* or if it simply chooses not to queue more I/O at one point, it can
* call this function to prevent the request_fn from being called until
* the driver has signalled it's ready to go again. This happens by calling
* blk_start_queue() to restart queue operations.
**/
void blk_stop_queue(request_queue_t *q)
{
set_bit(QUEUE_FLAG_STOPPED, &q->queue_flags);
}
/*
* the equivalent of the previous tq_disk run
*/
/**
* blk_run_queues - fire all plugged queues
*
* Description:
* Start I/O on all plugged queues known to the block layer. Queues that
* are currently stopped are ignored. This is equivalent to the older
* tq_disk task queue run.
**/
void blk_run_queues(void)
{
struct list_head *n, *tmp, local_plug_list;
......
......@@ -909,8 +909,7 @@ static struct ata_device *choose_urgent_device(struct ata_channel *channel)
mod_timer(&channel->timer, sleep);
/* we purposely leave hwgroup busy while sleeping */
} else {
/* Ugly, but how can we sleep for the lock otherwise? perhaps
* from tq_disk? */
/* Ugly, but how can we sleep for the lock otherwise? */
ide_release_lock(&irq_lock);/* for atari only */
clear_bit(IDE_BUSY, channel->active);
}
......
......@@ -1813,7 +1813,7 @@ static int lbmRead(log_t * log, int pn, lbuf_t ** bpp)
bio->bi_end_io = lbmIODone;
bio->bi_private = bp;
submit_bio(READ, bio);
run_task_queue(&tq_disk);
blk_run_queues();
wait_event(bp->l_ioevent, (bp->l_flag != lbmREAD));
......@@ -1958,7 +1958,7 @@ void lbmStartIO(lbuf_t * bp)
submit_bio(WRITE, bio);
INCREMENT(lmStat.submitted);
run_task_queue(&tq_disk);
blk_run_queues();
jFYI(1, ("lbmStartIO done\n"));
}
......
......@@ -355,7 +355,7 @@ do { \
if (condition) \
break; \
spin_unlock_irq(&lock); \
run_task_queue(&tq_disk); \
blk_run_queues(); \
schedule(); \
spin_lock_irq(&lock); \
} \
......@@ -381,7 +381,7 @@ do { \
set_current_state(TASK_UNINTERRUPTIBLE); \
if (condition) \
break; \
run_task_queue(&tq_disk); \
blk_run_queues(); \
schedule(); \
} \
current->state = TASK_RUNNING; \
......
......@@ -300,7 +300,8 @@ static __inline__ int fill_suspend_header(struct suspend_header *sh)
static void do_suspend_sync(void)
{
while (1) {
run_task_queue(&tq_disk);
blk_run_queues();
#error this is broken, FIXME
if (!TQ_ACTIVE(tq_disk))
break;
printk(KERN_ERR "Hm, tq_disk is not empty after run_task_queue\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment