summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2008-07-24 20:36:59 -0700
committerRoland Dreier <rolandd@cisco.com>2008-07-24 20:36:59 -0700
commit5ba18b186c979283a2bf75a28b7ea325184b0c08 (patch)
tree3a9c51629ce217d92f4315fbe3b6cedf905f2635 /drivers/infiniband
parentf7a6117ee59c0001d58e830a82d7e205ed602bdd (diff)
downloadtalos-op-linux-5ba18b186c979283a2bf75a28b7ea325184b0c08.tar.gz
talos-op-linux-5ba18b186c979283a2bf75a28b7ea325184b0c08.zip
RDMA/ucm: BKL is not needed for ib_ucm_open()
Remove explicit cycle_kernel_lock() call and document why the code is safe. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/ucm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 9494005d1c9a..e603736682bf 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -43,7 +43,6 @@
#include <linux/cdev.h>
#include <linux/idr.h>
#include <linux/mutex.h>
-#include <linux/smp_lock.h>
#include <asm/uaccess.h>
@@ -1154,11 +1153,18 @@ static unsigned int ib_ucm_poll(struct file *filp,
return mask;
}
+/*
+ * ib_ucm_open() does not need the BKL:
+ *
+ * - no global state is referred to;
+ * - there is no ioctl method to race against;
+ * - no further module initialization is required for open to work
+ * after the device is registered.
+ */
static int ib_ucm_open(struct inode *inode, struct file *filp)
{
struct ib_ucm_file *file;
- cycle_kernel_lock();
file = kmalloc(sizeof(*file), GFP_KERNEL);
if (!file)
return -ENOMEM;
OpenPOWER on IntegriCloud