]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/core/uverbs_main.c
infiniband: more BKL pushdown
[linux-2.6-omap-h63xx.git] / drivers / infiniband / core / uverbs_main.c
index cc1afa28c18145839049e51c03f0a5da4f30844e..8ede1e475ce69c016b85acc81a43c096275a5b12 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/file.h>
 #include <linux/mount.h>
 #include <linux/cdev.h>
+#include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
 
@@ -616,14 +617,17 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp)
        struct ib_uverbs_file *file;
        int ret;
 
+       lock_kernel();
        spin_lock(&map_lock);
        dev = dev_table[iminor(inode) - IB_UVERBS_BASE_MINOR];
        if (dev)
                kref_get(&dev->ref);
        spin_unlock(&map_lock);
 
-       if (!dev)
+       if (!dev) {
+               unlock_kernel();
                return -ENXIO;
+       }
 
        if (!try_module_get(dev->ib_dev->owner)) {
                ret = -ENODEV;
@@ -644,6 +648,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp)
 
        filp->private_data = file;
 
+       unlock_kernel();
        return 0;
 
 err_module:
@@ -651,7 +656,7 @@ err_module:
 
 err:
        kref_put(&dev->ref, ib_uverbs_release_dev);
-
+       unlock_kernel();
        return ret;
 }