diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd.c | 8 | ||||
-rw-r--r-- | drivers/s390/block/dcssblk.c | 5 | ||||
-rw-r--r-- | drivers/s390/char/tape_block.c | 8 |
3 files changed, 19 insertions, 2 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 33975e922d65..1a84fae155e1 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/hdreg.h> | 21 | #include <linux/hdreg.h> |
22 | #include <linux/async.h> | 22 | #include <linux/async.h> |
23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/smp_lock.h> | ||
24 | 25 | ||
25 | #include <asm/ccwdev.h> | 26 | #include <asm/ccwdev.h> |
26 | #include <asm/ebcdic.h> | 27 | #include <asm/ebcdic.h> |
@@ -2196,7 +2197,7 @@ static void dasd_setup_queue(struct dasd_block *block) | |||
2196 | */ | 2197 | */ |
2197 | blk_queue_max_segment_size(block->request_queue, PAGE_SIZE); | 2198 | blk_queue_max_segment_size(block->request_queue, PAGE_SIZE); |
2198 | blk_queue_segment_boundary(block->request_queue, PAGE_SIZE - 1); | 2199 | blk_queue_segment_boundary(block->request_queue, PAGE_SIZE - 1); |
2199 | blk_queue_ordered(block->request_queue, QUEUE_ORDERED_DRAIN, NULL); | 2200 | blk_queue_ordered(block->request_queue, QUEUE_ORDERED_DRAIN); |
2200 | } | 2201 | } |
2201 | 2202 | ||
2202 | /* | 2203 | /* |
@@ -2235,6 +2236,7 @@ static int dasd_open(struct block_device *bdev, fmode_t mode) | |||
2235 | if (!block) | 2236 | if (!block) |
2236 | return -ENODEV; | 2237 | return -ENODEV; |
2237 | 2238 | ||
2239 | lock_kernel(); | ||
2238 | base = block->base; | 2240 | base = block->base; |
2239 | atomic_inc(&block->open_count); | 2241 | atomic_inc(&block->open_count); |
2240 | if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) { | 2242 | if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) { |
@@ -2269,12 +2271,14 @@ static int dasd_open(struct block_device *bdev, fmode_t mode) | |||
2269 | goto out; | 2271 | goto out; |
2270 | } | 2272 | } |
2271 | 2273 | ||
2274 | unlock_kernel(); | ||
2272 | return 0; | 2275 | return 0; |
2273 | 2276 | ||
2274 | out: | 2277 | out: |
2275 | module_put(base->discipline->owner); | 2278 | module_put(base->discipline->owner); |
2276 | unlock: | 2279 | unlock: |
2277 | atomic_dec(&block->open_count); | 2280 | atomic_dec(&block->open_count); |
2281 | unlock_kernel(); | ||
2278 | return rc; | 2282 | return rc; |
2279 | } | 2283 | } |
2280 | 2284 | ||
@@ -2282,8 +2286,10 @@ static int dasd_release(struct gendisk *disk, fmode_t mode) | |||
2282 | { | 2286 | { |
2283 | struct dasd_block *block = disk->private_data; | 2287 | struct dasd_block *block = disk->private_data; |
2284 | 2288 | ||
2289 | lock_kernel(); | ||
2285 | atomic_dec(&block->open_count); | 2290 | atomic_dec(&block->open_count); |
2286 | module_put(block->base->discipline->owner); | 2291 | module_put(block->base->discipline->owner); |
2292 | unlock_kernel(); | ||
2287 | return 0; | 2293 | return 0; |
2288 | } | 2294 | } |
2289 | 2295 | ||
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 9b43ae94beba..2bd72aa34c59 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/blkdev.h> | 16 | #include <linux/blkdev.h> |
17 | #include <linux/smp_lock.h> | ||
17 | #include <linux/completion.h> | 18 | #include <linux/completion.h> |
18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
@@ -775,6 +776,7 @@ dcssblk_open(struct block_device *bdev, fmode_t mode) | |||
775 | struct dcssblk_dev_info *dev_info; | 776 | struct dcssblk_dev_info *dev_info; |
776 | int rc; | 777 | int rc; |
777 | 778 | ||
779 | lock_kernel(); | ||
778 | dev_info = bdev->bd_disk->private_data; | 780 | dev_info = bdev->bd_disk->private_data; |
779 | if (NULL == dev_info) { | 781 | if (NULL == dev_info) { |
780 | rc = -ENODEV; | 782 | rc = -ENODEV; |
@@ -784,6 +786,7 @@ dcssblk_open(struct block_device *bdev, fmode_t mode) | |||
784 | bdev->bd_block_size = 4096; | 786 | bdev->bd_block_size = 4096; |
785 | rc = 0; | 787 | rc = 0; |
786 | out: | 788 | out: |
789 | unlock_kernel(); | ||
787 | return rc; | 790 | return rc; |
788 | } | 791 | } |
789 | 792 | ||
@@ -794,6 +797,7 @@ dcssblk_release(struct gendisk *disk, fmode_t mode) | |||
794 | struct segment_info *entry; | 797 | struct segment_info *entry; |
795 | int rc; | 798 | int rc; |
796 | 799 | ||
800 | lock_kernel(); | ||
797 | if (!dev_info) { | 801 | if (!dev_info) { |
798 | rc = -ENODEV; | 802 | rc = -ENODEV; |
799 | goto out; | 803 | goto out; |
@@ -811,6 +815,7 @@ dcssblk_release(struct gendisk *disk, fmode_t mode) | |||
811 | up_write(&dcssblk_devices_sem); | 815 | up_write(&dcssblk_devices_sem); |
812 | rc = 0; | 816 | rc = 0; |
813 | out: | 817 | out: |
818 | unlock_kernel(); | ||
814 | return rc; | 819 | return rc; |
815 | } | 820 | } |
816 | 821 | ||
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 097da8ce6be6..b7de02525ec9 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/blkdev.h> | 18 | #include <linux/blkdev.h> |
19 | #include <linux/smp_lock.h> | ||
19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
20 | #include <linux/buffer_head.h> | 21 | #include <linux/buffer_head.h> |
21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
@@ -361,6 +362,7 @@ tapeblock_open(struct block_device *bdev, fmode_t mode) | |||
361 | struct tape_device * device; | 362 | struct tape_device * device; |
362 | int rc; | 363 | int rc; |
363 | 364 | ||
365 | lock_kernel(); | ||
364 | device = tape_get_device(disk->private_data); | 366 | device = tape_get_device(disk->private_data); |
365 | 367 | ||
366 | if (device->required_tapemarks) { | 368 | if (device->required_tapemarks) { |
@@ -384,12 +386,14 @@ tapeblock_open(struct block_device *bdev, fmode_t mode) | |||
384 | * is called. | 386 | * is called. |
385 | */ | 387 | */ |
386 | tape_state_set(device, TS_BLKUSE); | 388 | tape_state_set(device, TS_BLKUSE); |
389 | unlock_kernel(); | ||
387 | return 0; | 390 | return 0; |
388 | 391 | ||
389 | release: | 392 | release: |
390 | tape_release(device); | 393 | tape_release(device); |
391 | put_device: | 394 | put_device: |
392 | tape_put_device(device); | 395 | tape_put_device(device); |
396 | unlock_kernel(); | ||
393 | return rc; | 397 | return rc; |
394 | } | 398 | } |
395 | 399 | ||
@@ -403,10 +407,12 @@ static int | |||
403 | tapeblock_release(struct gendisk *disk, fmode_t mode) | 407 | tapeblock_release(struct gendisk *disk, fmode_t mode) |
404 | { | 408 | { |
405 | struct tape_device *device = disk->private_data; | 409 | struct tape_device *device = disk->private_data; |
406 | 410 | ||
411 | lock_kernel(); | ||
407 | tape_state_set(device, TS_IN_USE); | 412 | tape_state_set(device, TS_IN_USE); |
408 | tape_release(device); | 413 | tape_release(device); |
409 | tape_put_device(device); | 414 | tape_put_device(device); |
415 | unlock_kernel(); | ||
410 | 416 | ||
411 | return 0; | 417 | return 0; |
412 | } | 418 | } |