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
commitf7a6117ee59c0001d58e830a82d7e205ed602bdd (patch)
tree8317ca6d2b53afde70905ed5986a1556a144774f /drivers/infiniband/core
parentfb2e405fc1fc8b20d9c78eaa1c7fd5a297efde43 (diff)
RDMA/ucma: BKL is not needed for ucma_open()
Remove explicit lock_kernel() calls 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/ucma.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 195f97302fe5..b41dd26bbfa1 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -38,7 +38,6 @@
38#include <linux/in.h> 38#include <linux/in.h>
39#include <linux/in6.h> 39#include <linux/in6.h>
40#include <linux/miscdevice.h> 40#include <linux/miscdevice.h>
41#include <linux/smp_lock.h>
42 41
43#include <rdma/rdma_user_cm.h> 42#include <rdma/rdma_user_cm.h>
44#include <rdma/ib_marshall.h> 43#include <rdma/ib_marshall.h>
@@ -1149,6 +1148,14 @@ static unsigned int ucma_poll(struct file *filp, struct poll_table_struct *wait)
1149 return mask; 1148 return mask;
1150} 1149}
1151 1150
1151/*
1152 * ucma_open() does not need the BKL:
1153 *
1154 * - no global state is referred to;
1155 * - there is no ioctl method to race against;
1156 * - no further module initialization is required for open to work
1157 * after the device is registered.
1158 */
1152static int ucma_open(struct inode *inode, struct file *filp) 1159static int ucma_open(struct inode *inode, struct file *filp)
1153{ 1160{
1154 struct ucma_file *file; 1161 struct ucma_file *file;
@@ -1157,7 +1164,6 @@ static int ucma_open(struct inode *inode, struct file *filp)
1157 if (!file) 1164 if (!file)
1158 return -ENOMEM; 1165 return -ENOMEM;
1159 1166
1160 lock_kernel();
1161 INIT_LIST_HEAD(&file->event_list); 1167 INIT_LIST_HEAD(&file->event_list);
1162 INIT_LIST_HEAD(&file->ctx_list); 1168 INIT_LIST_HEAD(&file->ctx_list);
1163 init_waitqueue_head(&file->poll_wait); 1169 init_waitqueue_head(&file->poll_wait);
@@ -1165,7 +1171,6 @@ static int ucma_open(struct inode *inode, struct file *filp)
1165 1171
1166 filp->private_data = file; 1172 filp->private_data = file;
1167 file->filp = filp; 1173 file->filp = filp;
1168 unlock_kernel();
1169 return 0; 1174 return 0;
1170} 1175}
1171 1176