]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/block/aoe/aoeblk.c
block: push down BKL into .open and .release
[net-next-2.6.git] / drivers / block / aoe / aoeblk.c
index 65deffde60acadb7ae3329a0485ba1552b75c941..a946929735a5818e525c14e97b9011913f9e54f9 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include <linux/genhd.h>
 #include <linux/netdevice.h>
+#include <linux/smp_lock.h>
 #include "aoe.h"
 
 static struct kmem_cache *buf_pool_cache;
@@ -124,13 +125,16 @@ aoeblk_open(struct block_device *bdev, fmode_t mode)
        struct aoedev *d = bdev->bd_disk->private_data;
        ulong flags;
 
+       lock_kernel();
        spin_lock_irqsave(&d->lock, flags);
        if (d->flags & DEVFL_UP) {
                d->nopen++;
                spin_unlock_irqrestore(&d->lock, flags);
+               unlock_kernel();
                return 0;
        }
        spin_unlock_irqrestore(&d->lock, flags);
+       unlock_kernel();
        return -ENODEV;
 }