Commit ccb77d05 authored by Andrew Morton's avatar Andrew Morton Committed by Vojtech Pavlik

[PATCH] set unplug_timer.function inside blk_queue_make_request

Patch from Neil Brown <neilb@cse.unsw.edu.au>

Initialise the queue's unplug_timer inside blk_queue_make_request.  This
makes the new auto-unplugging more accessable by other clients of
blk_queue_make_request - e.g.  raid5, umem.
parent 6e7ce541
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/slab.h> #include <linux/slab.h>
static void blk_unplug_work(void *data); static void blk_unplug_work(void *data);
static void blk_unplug_timeout(unsigned long data);
/* /*
* For the allocated request tables * For the allocated request tables
...@@ -247,6 +248,9 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn) ...@@ -247,6 +248,9 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn)
init_timer(&q->unplug_timer); init_timer(&q->unplug_timer);
INIT_WORK(&q->unplug_work, blk_unplug_work, q); INIT_WORK(&q->unplug_work, blk_unplug_work, q);
q->unplug_timer.function = blk_unplug_timeout;
q->unplug_timer.data = (unsigned long)q;
/* /*
* by default assume old behaviour and bounce for any highmem page * by default assume old behaviour and bounce for any highmem page
*/ */
...@@ -1298,9 +1302,6 @@ int blk_init_queue(request_queue_t *q, request_fn_proc *rfn, spinlock_t *lock) ...@@ -1298,9 +1302,6 @@ int blk_init_queue(request_queue_t *q, request_fn_proc *rfn, spinlock_t *lock)
blk_queue_make_request(q, __make_request); blk_queue_make_request(q, __make_request);
blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE);
q->unplug_timer.function = blk_unplug_timeout;
q->unplug_timer.data = (unsigned long)q;
blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS); blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS); blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
......
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