diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-01 14:46:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-01 14:46:00 -0400 |
commit | b17b3d479c4c43c3a980ee553c3be3ca456523de (patch) | |
tree | 6715c10bfe1301eb3c112b17a858b541ce14aef5 | |
parent | 31582b094d640fdab3fd29237b348a4c7c8646fb (diff) | |
parent | 93769f58078e2a066b56217cae1e343ac5a6b78c (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
md: the bitmap code needs to use blk_plug_device_unlocked()
block: add a blk_plug_device_unlocked() that grabs the queue lock
-rw-r--r-- | block/blk-core.c | 18 | ||||
-rw-r--r-- | drivers/md/bitmap.c | 2 | ||||
-rw-r--r-- | include/linux/blkdev.h | 1 |
3 files changed, 20 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index fef79ccb2a11..4889eb86a39e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -212,6 +212,24 @@ void blk_plug_device(struct request_queue *q) | |||
212 | } | 212 | } |
213 | EXPORT_SYMBOL(blk_plug_device); | 213 | EXPORT_SYMBOL(blk_plug_device); |
214 | 214 | ||
215 | /** | ||
216 | * blk_plug_device_unlocked - plug a device without queue lock held | ||
217 | * @q: The &struct request_queue to plug | ||
218 | * | ||
219 | * Description: | ||
220 | * Like @blk_plug_device(), but grabs the queue lock and disables | ||
221 | * interrupts. | ||
222 | **/ | ||
223 | void blk_plug_device_unlocked(struct request_queue *q) | ||
224 | { | ||
225 | unsigned long flags; | ||
226 | |||
227 | spin_lock_irqsave(q->queue_lock, flags); | ||
228 | blk_plug_device(q); | ||
229 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
230 | } | ||
231 | EXPORT_SYMBOL(blk_plug_device_unlocked); | ||
232 | |||
215 | /* | 233 | /* |
216 | * remove the queue from the plugged list, if present. called with | 234 | * remove the queue from the plugged list, if present. called with |
217 | * queue lock held and interrupts disabled. | 235 | * queue lock held and interrupts disabled. |
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 621a272a2c74..7e65bad522cb 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1234,7 +1234,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect | |||
1234 | case 0: | 1234 | case 0: |
1235 | bitmap_file_set_bit(bitmap, offset); | 1235 | bitmap_file_set_bit(bitmap, offset); |
1236 | bitmap_count_page(bitmap,offset, 1); | 1236 | bitmap_count_page(bitmap,offset, 1); |
1237 | blk_plug_device(bitmap->mddev->queue); | 1237 | blk_plug_device_unlocked(bitmap->mddev->queue); |
1238 | /* fall through */ | 1238 | /* fall through */ |
1239 | case 1: | 1239 | case 1: |
1240 | *bmc = 2; | 1240 | *bmc = 2; |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 88d68081a0f1..e61f22be4d0e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -655,6 +655,7 @@ extern struct request *blk_get_request(struct request_queue *, int, gfp_t); | |||
655 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); | 655 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); |
656 | extern void blk_requeue_request(struct request_queue *, struct request *); | 656 | extern void blk_requeue_request(struct request_queue *, struct request *); |
657 | extern void blk_plug_device(struct request_queue *); | 657 | extern void blk_plug_device(struct request_queue *); |
658 | extern void blk_plug_device_unlocked(struct request_queue *); | ||
658 | extern int blk_remove_plug(struct request_queue *); | 659 | extern int blk_remove_plug(struct request_queue *); |
659 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 660 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
660 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, | 661 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, |