All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] 2.6.19-rc2-mm1 ll_rw_blk.c: export clear_queue_congested and set_queue_congested
@ 2006-10-17 19:42 Thomas Maier
  2006-10-17 20:39 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Maier @ 2006-10-17 19:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: petero2, akpm, Jens Axboe

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

Hello,

this patch exports the clear_queue_congested()
and set_queue_congested() functions located in ll_rw_blk.c

The functions are renamed to blk_clear_queue_congested()
and blk_set_queue_congested().

(needed in the pktcdvd driver's bio write congestion control)

(have the bits set with set_queue_congested() any use?
seems they are never used by anyone....)

Signed-off-by: Thomas Maier <balagi@justmail.de>


[-- Attachment #2: 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1.patch --]
[-- Type: application/octet-stream, Size: 3445 bytes --]

diff -urpN linux-2.6.19-rc2-mm1.blk/block/ll_rw_blk.c 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/block/ll_rw_blk.c
--- linux-2.6.19-rc2-mm1.blk/block/ll_rw_blk.c	2006-10-17 21:20:42.000000000 +0200
+++ 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/block/ll_rw_blk.c	2006-10-17 21:17:21.000000000 +0200
@@ -117,7 +117,7 @@ static void blk_queue_congestion_thresho
  * congested queues, and wake up anyone who was waiting for requests to be
  * put back.
  */
-static void clear_queue_congested(request_queue_t *q, int rw)
+void blk_clear_queue_congested(request_queue_t *q, int rw)
 {
 	enum bdi_state bit;
 	wait_queue_head_t *wqh = &congestion_wqh[rw];
@@ -129,11 +129,13 @@ static void clear_queue_congested(reques
 		wake_up(wqh);
 }
 
+EXPORT_SYMBOL(blk_clear_queue_congested);
+
 /*
  * A queue has just entered congestion.  Flag that in the queue's VM-visible
  * state flags and increment the global gounter of congested queues.
  */
-static void set_queue_congested(request_queue_t *q, int rw)
+void blk_set_queue_congested(request_queue_t *q, int rw)
 {
 	enum bdi_state bit;
 
@@ -141,6 +143,8 @@ static void set_queue_congested(request_
 	set_bit(bit, &q->backing_dev_info.state);
 }
 
+EXPORT_SYMBOL(blk_set_queue_congested);
+
 /**
  * blk_get_backing_dev_info - get the address of a queue's backing_dev_info
  * @bdev:	device
@@ -2066,7 +2070,7 @@ static void __freed_request(request_queu
 	struct request_list *rl = &q->rq;
 
 	if (rl->count[rw] < queue_congestion_off_threshold(q))
-		clear_queue_congested(q, rw);
+		blk_clear_queue_congested(q, rw);
 
 	if (rl->count[rw] + 1 <= q->nr_requests) {
 		if (waitqueue_active(&rl->wait[rw]))
@@ -2136,7 +2140,7 @@ static struct request *get_request(reque
 				}
 			}
 		}
-		set_queue_congested(q, rw);
+		blk_set_queue_congested(q, rw);
 	}
 
 	/*
@@ -3824,14 +3828,14 @@ queue_requests_store(struct request_queu
 	blk_queue_congestion_threshold(q);
 
 	if (rl->count[READ] >= queue_congestion_on_threshold(q))
-		set_queue_congested(q, READ);
+		blk_set_queue_congested(q, READ);
 	else if (rl->count[READ] < queue_congestion_off_threshold(q))
-		clear_queue_congested(q, READ);
+		blk_clear_queue_congested(q, READ);
 
 	if (rl->count[WRITE] >= queue_congestion_on_threshold(q))
-		set_queue_congested(q, WRITE);
+		blk_set_queue_congested(q, WRITE);
 	else if (rl->count[WRITE] < queue_congestion_off_threshold(q))
-		clear_queue_congested(q, WRITE);
+		blk_clear_queue_congested(q, WRITE);
 
 	if (rl->count[READ] >= q->nr_requests) {
 		blk_set_queue_full(q, READ);
diff -urpN linux-2.6.19-rc2-mm1.blk/include/linux/blkdev.h 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/include/linux/blkdev.h
--- linux-2.6.19-rc2-mm1.blk/include/linux/blkdev.h	2006-10-17 21:20:42.000000000 +0200
+++ 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/include/linux/blkdev.h	2006-10-17 21:17:21.000000000 +0200
@@ -651,6 +651,8 @@ extern void blk_recount_segments(request
 extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
 extern int sg_scsi_ioctl(struct file *, struct request_queue *,
 		struct gendisk *, struct scsi_ioctl_command __user *);
+extern void blk_clear_queue_congested(request_queue_t *q, int rw);
+extern void blk_set_queue_congested(request_queue_t *q, int rw);
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void blk_sync_queue(struct request_queue *q);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-17 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-17 19:42 [PATCH 1/2] 2.6.19-rc2-mm1 ll_rw_blk.c: export clear_queue_congested and set_queue_congested Thomas Maier
2006-10-17 20:39 ` Andrew Morton
2006-10-17 21:10   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.