]> git.hungrycats.org Git - linux/commitdiff
[PATCH] return remaining jiffies from blk_congestion_wait()
authorAndrew Morton <akpm@osdl.org>
Fri, 12 Mar 2004 00:22:15 +0000 (16:22 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 12 Mar 2004 00:22:15 +0000 (16:22 -0800)
Teach blk_congestion_wait() to return the number of jiffies remaining.  This
is for debug, but it is also nicely consistent.

drivers/block/ll_rw_blk.c
include/linux/blkdev.h

index 7066fef79596ef6ede7f065347d7a5e99dfedbfe..5371a98fe6ba9c3412015f2cc2af3f6c75d32669 100644 (file)
@@ -2040,15 +2040,17 @@ EXPORT_SYMBOL(blk_put_request);
  * If no queues are congested then just wait for the next request to be
  * returned.
  */
-void blk_congestion_wait(int rw, long timeout)
+long blk_congestion_wait(int rw, long timeout)
 {
+       long ret;
        DEFINE_WAIT(wait);
        wait_queue_head_t *wqh = &congestion_wqh[rw];
 
        blk_run_queues();
        prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
-       io_schedule_timeout(timeout);
+       ret = io_schedule_timeout(timeout);
        finish_wait(wqh, &wait);
+       return ret;
 }
 
 EXPORT_SYMBOL(blk_congestion_wait);
index 189f7977ad11a23204b01b7804df542f6ac5e171..1a521e16b398e419d990695ef8076516b048ad30 100644 (file)
@@ -592,7 +592,7 @@ extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *);
 extern void blk_queue_free_tags(request_queue_t *);
 extern int blk_queue_resize_tags(request_queue_t *, int);
 extern void blk_queue_invalidate_tags(request_queue_t *);
-extern void blk_congestion_wait(int rw, long timeout);
+extern long blk_congestion_wait(int rw, long timeout);
 
 extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
 extern void blk_rq_prep_restart(struct request *);