]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/s390/char/tape_block.c
block: push down BKL into .open and .release
[net-next-2.6.git] / drivers / s390 / char / tape_block.c
index 097da8ce6be6631eb515105773e523be43f02fb5..b7de02525ec901ebbee390b2798043eb1938f4bd 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
+#include <linux/smp_lock.h>
 #include <linux/interrupt.h>
 #include <linux/buffer_head.h>
 #include <linux/kernel.h>
@@ -361,6 +362,7 @@ tapeblock_open(struct block_device *bdev, fmode_t mode)
        struct tape_device *    device;
        int                     rc;
 
+       lock_kernel();
        device = tape_get_device(disk->private_data);
 
        if (device->required_tapemarks) {
@@ -384,12 +386,14 @@ tapeblock_open(struct block_device *bdev, fmode_t mode)
         *       is called.
         */
        tape_state_set(device, TS_BLKUSE);
+       unlock_kernel();
        return 0;
 
 release:
        tape_release(device);
  put_device:
        tape_put_device(device);
+       unlock_kernel();
        return rc;
 }
 
@@ -403,10 +407,12 @@ static int
 tapeblock_release(struct gendisk *disk, fmode_t mode)
 {
        struct tape_device *device = disk->private_data;
-
+       lock_kernel();
        tape_state_set(device, TS_IN_USE);
        tape_release(device);
        tape_put_device(device);
+       unlock_kernel();
 
        return 0;
 }