aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2008-07-24 23:36:59 -0400
committerRoland Dreier <rolandd@cisco.com>2008-07-24 23:36:59 -0400
commit5ba18b186c979283a2bf75a28b7ea325184b0c08 (patch)
tree3a9c51629ce217d92f4315fbe3b6cedf905f2635 /drivers/infiniband/core
parentf7a6117ee59c0001d58e830a82d7e205ed602bdd (diff)
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/core')
-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 @@
43#include <linux/cdev.h> 43#include <linux/cdev.h>
44#include <linux/idr.h> 44#include <linux/idr.h>
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46#include <linux/smp_lock.h>
47 46
48#include <asm/uaccess.h> 47#include <asm/uaccess.h>
49 48
@@ -1154,11 +1153,18 @@ static unsigned int ib_ucm_poll(struct file *filp,
1154 return mask; 1153 return mask;
1155} 1154}
1156 1155
1156/*
1157 * ib_ucm_open() does not need the BKL:
1158 *
1159 * - no global state is referred to;
1160 * - there is no ioctl method to race against;
1161 * - no further module initialization is required for open to work
1162 * after the device is registered.
1163 */
1157static int ib_ucm_open(struct inode *inode, struct file *filp) 1164static int ib_ucm_open(struct inode *inode, struct file *filp)
1158{ 1165{
1159 struct ib_ucm_file *file; 1166 struct ib_ucm_file *file;
1160 1167
1161 cycle_kernel_lock();
1162 file = kmalloc(sizeof(*file), GFP_KERNEL); 1168 file = kmalloc(sizeof(*file), GFP_KERNEL);
1163 if (!file) 1169 if (!file)
1164 return -ENOMEM; 1170 return -ENOMEM;