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>

+8 -2
+8 -2
drivers/infiniband/core/ucm.c
··· 43 43 #include <linux/cdev.h> 44 44 #include <linux/idr.h> 45 45 #include <linux/mutex.h> 46 - #include <linux/smp_lock.h> 47 46 48 47 #include <asm/uaccess.h> 49 48 ··· 1153 1154 return mask; 1154 1155 } 1155 1156 1157 + /* 1158 + * ib_ucm_open() does not need the BKL: 1159 + * 1160 + * - no global state is referred to; 1161 + * - there is no ioctl method to race against; 1162 + * - no further module initialization is required for open to work 1163 + * after the device is registered. 1164 + */ 1156 1165 static int ib_ucm_open(struct inode *inode, struct file *filp) 1157 1166 { 1158 1167 struct ib_ucm_file *file; 1159 1168 1160 - cycle_kernel_lock(); 1161 1169 file = kmalloc(sizeof(*file), GFP_KERNEL); 1162 1170 if (!file) 1163 1171 return -ENOMEM;