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 #include <linux/cdev.h> 44 #include <linux/idr.h> 45 #include <linux/mutex.h> 46 - #include <linux/smp_lock.h> 47 48 #include <asm/uaccess.h> 49 ··· 1153 return mask; 1154 } 1155 1156 static int ib_ucm_open(struct inode *inode, struct file *filp) 1157 { 1158 struct ib_ucm_file *file; 1159 1160 - cycle_kernel_lock(); 1161 file = kmalloc(sizeof(*file), GFP_KERNEL); 1162 if (!file) 1163 return -ENOMEM;
··· 43 #include <linux/cdev.h> 44 #include <linux/idr.h> 45 #include <linux/mutex.h> 46 47 #include <asm/uaccess.h> 48 ··· 1154 return mask; 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 + */ 1165 static int ib_ucm_open(struct inode *inode, struct file *filp) 1166 { 1167 struct ib_ucm_file *file; 1168 1169 file = kmalloc(sizeof(*file), GFP_KERNEL); 1170 if (!file) 1171 return -ENOMEM;