summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorAlan D. Brunelle <Alan.Brunelle@hp.com>2007-11-07 14:26:56 -0500
committerJens Axboe <jens.axboe@oracle.com>2007-11-09 13:41:32 +0100
commit2ad8b1ef11c98c5603580878aebf9f1bc74129e4 (patch)
treef7bdc2484513f6ffd174b1385bb216dcf97d2c78 /block
parentd85532ed284e63b5c56eaf2418f262822af60be4 (diff)
Add UNPLUG traces to all appropriate places
Added blk_unplug interface, allowing all invocations of unplugs to result in a generated blktrace UNPLUG. Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/ll_rw_blk.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 3d489915fd22..3b927be03850 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1621,15 +1621,7 @@ static void blk_backing_dev_unplug(struct backing_dev_info *bdi,
{
struct request_queue *q = bdi->unplug_io_data;
- /*
- * devices don't necessarily have an ->unplug_fn defined
- */
- if (q->unplug_fn) {
- blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
- q->rq.count[READ] + q->rq.count[WRITE]);
-
- q->unplug_fn(q);
- }
+ blk_unplug(q);
}
static void blk_unplug_work(struct work_struct *work)
@@ -1653,6 +1645,20 @@ static void blk_unplug_timeout(unsigned long data)
kblockd_schedule_work(&q->unplug_work);
}
+void blk_unplug(struct request_queue *q)
+{
+ /*
+ * devices don't necessarily have an ->unplug_fn defined
+ */
+ if (q->unplug_fn) {
+ blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
+ q->rq.count[READ] + q->rq.count[WRITE]);
+
+ q->unplug_fn(q);
+ }
+}
+EXPORT_SYMBOL(blk_unplug);
+
/**
* blk_start_queue - restart a previously stopped queue
* @q: The &struct request_queue in question