Commit f3179458 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] return remaining jiffies from blk_congestion_wait()

Teach blk_congestion_wait() to return the number of jiffies remaining.  This
is for debug, but it is also nicely consistent.
parent 760d95b5
...@@ -2040,15 +2040,17 @@ EXPORT_SYMBOL(blk_put_request); ...@@ -2040,15 +2040,17 @@ EXPORT_SYMBOL(blk_put_request);
* If no queues are congested then just wait for the next request to be * If no queues are congested then just wait for the next request to be
* returned. * returned.
*/ */
void blk_congestion_wait(int rw, long timeout) long blk_congestion_wait(int rw, long timeout)
{ {
long ret;
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
wait_queue_head_t *wqh = &congestion_wqh[rw]; wait_queue_head_t *wqh = &congestion_wqh[rw];
blk_run_queues(); blk_run_queues();
prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
io_schedule_timeout(timeout); ret = io_schedule_timeout(timeout);
finish_wait(wqh, &wait); finish_wait(wqh, &wait);
return ret;
} }
EXPORT_SYMBOL(blk_congestion_wait); EXPORT_SYMBOL(blk_congestion_wait);
......
...@@ -592,7 +592,7 @@ extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *); ...@@ -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 void blk_queue_free_tags(request_queue_t *);
extern int blk_queue_resize_tags(request_queue_t *, int); extern int blk_queue_resize_tags(request_queue_t *, int);
extern void blk_queue_invalidate_tags(request_queue_t *); 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_bio_prep(request_queue_t *, struct request *, struct bio *);
extern void blk_rq_prep_restart(struct request *); extern void blk_rq_prep_restart(struct request *);
......
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