diff options
author | Andrew Morton <akpm@osdl.org> | 2006-10-20 02:28:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:35 -0400 |
commit | 3fcfab16c5b86eaa3db3a9a31adba550c5b67141 (patch) | |
tree | bd348fa081b8fbec2c79fbf8f173a306d70b2b2c /include/linux/blkdev.h | |
parent | 79e2de4bc53d7ca2a8eedee49e4a92479b4b530e (diff) |
[PATCH] separate bdi congestion functions from queue congestion functions
Separate out the concept of "queue congestion" from "backing-dev congestion".
Congestion is a backing-dev concept, not a queue concept.
The blk_* congestion functions are retained, as wrappers around the core
backing-dev congestion functions.
This proper layering is needed so that NFS can cleanly use the congestion
functions, and so that CONFIG_BLOCK=n actually links.
Cc: "Thomas Maier" <balagi@justmail.de>
Cc: "Jens Axboe" <jens.axboe@oracle.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: David Howells <dhowells@redhat.com>
Cc: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9575e3a5ff2a..7bfcde2d5578 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -651,8 +651,26 @@ extern void blk_recount_segments(request_queue_t *, struct bio *); | |||
651 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); | 651 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); |
652 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | 652 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, |
653 | struct gendisk *, struct scsi_ioctl_command __user *); | 653 | struct gendisk *, struct scsi_ioctl_command __user *); |
654 | extern void blk_clear_queue_congested(request_queue_t *q, int rw); | 654 | |
655 | extern void blk_set_queue_congested(request_queue_t *q, int rw); | 655 | /* |
656 | * A queue has just exitted congestion. Note this in the global counter of | ||
657 | * congested queues, and wake up anyone who was waiting for requests to be | ||
658 | * put back. | ||
659 | */ | ||
660 | static inline void blk_clear_queue_congested(request_queue_t *q, int rw) | ||
661 | { | ||
662 | clear_bdi_congested(&q->backing_dev_info, rw); | ||
663 | } | ||
664 | |||
665 | /* | ||
666 | * A queue has just entered congestion. Flag that in the queue's VM-visible | ||
667 | * state flags and increment the global gounter of congested queues. | ||
668 | */ | ||
669 | static inline void blk_set_queue_congested(request_queue_t *q, int rw) | ||
670 | { | ||
671 | set_bdi_congested(&q->backing_dev_info, rw); | ||
672 | } | ||
673 | |||
656 | extern void blk_start_queue(request_queue_t *q); | 674 | extern void blk_start_queue(request_queue_t *q); |
657 | extern void blk_stop_queue(request_queue_t *q); | 675 | extern void blk_stop_queue(request_queue_t *q); |
658 | extern void blk_sync_queue(struct request_queue *q); | 676 | extern void blk_sync_queue(struct request_queue *q); |
@@ -767,10 +785,8 @@ extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *); | |||
767 | extern void blk_queue_free_tags(request_queue_t *); | 785 | extern void blk_queue_free_tags(request_queue_t *); |
768 | extern int blk_queue_resize_tags(request_queue_t *, int); | 786 | extern int blk_queue_resize_tags(request_queue_t *, int); |
769 | extern void blk_queue_invalidate_tags(request_queue_t *); | 787 | extern void blk_queue_invalidate_tags(request_queue_t *); |
770 | extern long blk_congestion_wait(int rw, long timeout); | ||
771 | extern struct blk_queue_tag *blk_init_tags(int); | 788 | extern struct blk_queue_tag *blk_init_tags(int); |
772 | extern void blk_free_tags(struct blk_queue_tag *); | 789 | extern void blk_free_tags(struct blk_queue_tag *); |
773 | extern void blk_congestion_end(int rw); | ||
774 | 790 | ||
775 | static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | 791 | static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, |
776 | int tag) | 792 | int tag) |