

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/block/ll_rw_blk.c |   12 ++++++++++--
 25-akpm/drivers/md/linear.c       |    2 +-
 25-akpm/drivers/md/multipath.c    |    2 +-
 25-akpm/drivers/md/raid0.c        |    2 +-
 25-akpm/drivers/md/raid1.c        |    2 +-
 25-akpm/drivers/md/raid10.c       |    2 +-
 25-akpm/drivers/md/raid5.c        |    2 +-
 25-akpm/drivers/md/raid6main.c    |    2 +-
 25-akpm/include/linux/blkdev.h    |    1 +
 9 files changed, 18 insertions(+), 9 deletions(-)

diff -puN drivers/block/ll_rw_blk.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/block/ll_rw_blk.c
--- 25/drivers/block/ll_rw_blk.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.169486824 -0800
+++ 25-akpm/drivers/block/ll_rw_blk.c	2004-11-03 22:01:17.187484088 -0800
@@ -1358,10 +1358,19 @@ void blk_stop_queue(request_queue_t *q)
 	blk_remove_plug(q);
 	set_bit(QUEUE_FLAG_STOPPED, &q->queue_flags);
 }
-
 EXPORT_SYMBOL(blk_stop_queue);
 
 /**
+ * blk_sync_queue - prepare to destroy a queue
+ * @q: the queue
+ */
+void blk_sync_queue(struct request_queue *q)
+{
+	del_timer_sync(&q->unplug_timer);
+}
+EXPORT_SYMBOL(blk_sync_queue);
+
+/**
  * blk_run_queue - run a single device queue
  * @q:	The queue to run
  */
@@ -1374,7 +1383,6 @@ void blk_run_queue(struct request_queue 
 	q->request_fn(q);
 	spin_unlock_irqrestore(q->queue_lock, flags);
 }
-
 EXPORT_SYMBOL(blk_run_queue);
 
 /**
diff -puN drivers/md/linear.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/md/linear.c
--- 25/drivers/md/linear.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.171486520 -0800
+++ 25-akpm/drivers/md/linear.c	2004-11-03 22:08:40.309119360 -0800
@@ -231,7 +231,7 @@ static int linear_stop (mddev_t *mddev)
 {
 	linear_conf_t *conf = mddev_to_conf(mddev);
   
-	del_timer_sync(&mddev->queue->unplug_timer); /* the unplug fn references 'conf'*/
+	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
 	kfree(conf->hash_table);
 	kfree(conf);
 
diff -puN drivers/md/multipath.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/md/multipath.c
--- 25/drivers/md/multipath.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.172486368 -0800
+++ 25-akpm/drivers/md/multipath.c	2004-11-03 22:09:08.703802712 -0800
@@ -566,7 +566,7 @@ static int multipath_stop (mddev_t *mdde
 
 	md_unregister_thread(mddev->thread);
 	mddev->thread = NULL;
-	del_timer_sync(&mddev->queue->unplug_timer); /* the unplug fn references 'conf'*/
+	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
 	mempool_destroy(conf->pool);
 	kfree(conf->multipaths);
 	kfree(conf);
diff -puN drivers/md/raid0.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/md/raid0.c
--- 25/drivers/md/raid0.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.174486064 -0800
+++ 25-akpm/drivers/md/raid0.c	2004-11-03 22:01:17.342460528 -0800
@@ -385,7 +385,7 @@ static int raid0_stop (mddev_t *mddev)
 {
 	raid0_conf_t *conf = mddev_to_conf(mddev);
 
-	del_timer_sync(&mddev->queue->unplug_timer); /* the unplug fn references 'conf'*/
+	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
 	kfree (conf->hash_table);
 	conf->hash_table = NULL;
 	kfree (conf->strip_zone);
diff -puN drivers/md/raid10.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/md/raid10.c
--- 25/drivers/md/raid10.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.175485912 -0800
+++ 25-akpm/drivers/md/raid10.c	2004-11-03 22:09:08.704802560 -0800
@@ -1744,7 +1744,7 @@ static int stop(mddev_t *mddev)
 
 	md_unregister_thread(mddev->thread);
 	mddev->thread = NULL;
-	del_timer_sync(&mddev->queue->unplug_timer); /* the unplug fn references 'conf'*/
+	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
 	if (conf->r10bio_pool)
 		mempool_destroy(conf->r10bio_pool);
 	if (conf->mirrors)
diff -puN drivers/md/raid1.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/md/raid1.c
--- 25/drivers/md/raid1.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.177485608 -0800
+++ 25-akpm/drivers/md/raid1.c	2004-11-03 22:09:08.705802408 -0800
@@ -1293,7 +1293,7 @@ static int stop(mddev_t *mddev)
 
 	md_unregister_thread(mddev->thread);
 	mddev->thread = NULL;
-	del_timer_sync(&mddev->queue->unplug_timer); /* the unplug fn references 'conf'*/
+	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
 	if (conf->r1bio_pool)
 		mempool_destroy(conf->r1bio_pool);
 	if (conf->mirrors)
diff -puN drivers/md/raid5.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/md/raid5.c
--- 25/drivers/md/raid5.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.178485456 -0800
+++ 25-akpm/drivers/md/raid5.c	2004-11-03 22:09:08.707802104 -0800
@@ -1707,7 +1707,7 @@ static int stop (mddev_t *mddev)
 	mddev->thread = NULL;
 	shrink_stripes(conf);
 	free_pages((unsigned long) conf->stripe_hashtbl, HASH_PAGES_ORDER);
-	del_timer_sync(&mddev->queue->unplug_timer); /* the unplug fn references 'conf'*/
+	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
 	kfree(conf);
 	mddev->private = NULL;
 	return 0;
diff -puN drivers/md/raid6main.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup drivers/md/raid6main.c
--- 25/drivers/md/raid6main.c~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.180485152 -0800
+++ 25-akpm/drivers/md/raid6main.c	2004-11-03 22:09:08.709801800 -0800
@@ -1878,7 +1878,7 @@ static int stop (mddev_t *mddev)
 	mddev->thread = NULL;
 	shrink_stripes(conf);
 	free_pages((unsigned long) conf->stripe_hashtbl, HASH_PAGES_ORDER);
-	del_timer_sync(&mddev->queue->unplug_timer); /* the unplug fn references 'conf'*/
+	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
 	kfree(conf);
 	mddev->private = NULL;
 	return 0;
diff -puN include/linux/blkdev.h~md-delete-unplug-timer-before-shutting-down-md-array-cleanup include/linux/blkdev.h
--- 25/include/linux/blkdev.h~md-delete-unplug-timer-before-shutting-down-md-array-cleanup	2004-11-03 22:01:17.182484848 -0800
+++ 25-akpm/include/linux/blkdev.h	2004-11-03 22:01:17.586423440 -0800
@@ -522,6 +522,7 @@ extern int blk_hw_contig_segment(request
 extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
 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);
 extern void __blk_stop_queue(request_queue_t *q);
 extern void blk_run_queue(request_queue_t *);
 extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
_
