]> git.hungrycats.org Git - linux/commitdiff
[PATCH] documentation and tq_disk removals
authorJens Axboe <axboe@suse.de>
Sun, 2 Jun 2002 10:15:02 +0000 (03:15 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 2 Jun 2002 10:15:02 +0000 (03:15 -0700)
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.

drivers/block/ll_rw_blk.c
drivers/ide/ide.c
fs/jfs/jfs_logmgr.c
include/linux/raid/md_k.h
kernel/suspend.c

index 0de94d28405cd2bec617e1c1a9ce5ee37085d2da..9e42c51e4fbf8492e576142786d9d4fa2d46c0fa 100644 (file)
@@ -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;
index 26023c342d8aa21cb21bce071d90940bcc9b7c68..4891d28691734a44a674fa0337ebaacb2ed3b416 100644 (file)
@@ -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);
        }
index 8e7f423b8398073a6cc1a0d47ec6c8fc39296998..fffacf72af04736b3e84a1d5c71a8b1dfaaf7c90 100644 (file)
@@ -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"));
 }
index 62024cab73f2295f0facbf44e950287129f27568..7b270a50487ee7b9fb3fb1f11870d48a12e6df5f 100644 (file)
@@ -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;                                  \
index 565daab071436ccaf36f349130d096c8d7c2079d..c9c65946bd4e7292b1585681ab717232714ca786 100644 (file)
@@ -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");