PCI: Convert drivers/pci/proc.c to use unlocked_ioctl

Change access to inode thru file->f_dentry->d_inode, and add explicit
lock/unlock_kernel() calls.


Signed-off-by: Mathieu Segaud <mathieu.segaud@regala.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Mathieu Segaud and committed by Greg Kroah-Hartman add77184 2326e2b9

+8 -3
+8 -3
drivers/pci/proc.c
··· 11 11 #include <linux/module.h> 12 12 #include <linux/proc_fs.h> 13 13 #include <linux/seq_file.h> 14 + #include <linux/smp_lock.h> 14 15 #include <linux/capability.h> 15 16 #include <asm/uaccess.h> 16 17 #include <asm/byteorder.h> ··· 203 202 int write_combine; 204 203 }; 205 204 206 - static int proc_bus_pci_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 205 + static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, 206 + unsigned long arg) 207 207 { 208 - const struct proc_dir_entry *dp = PDE(inode); 208 + const struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); 209 209 struct pci_dev *dev = dp->data; 210 210 #ifdef HAVE_PCI_MMAP 211 211 struct pci_filp_private *fpriv = file->private_data; 212 212 #endif /* HAVE_PCI_MMAP */ 213 213 int ret = 0; 214 + 215 + lock_kernel(); 214 216 215 217 switch (cmd) { 216 218 case PCIIOC_CONTROLLER: ··· 243 239 break; 244 240 }; 245 241 242 + unlock_kernel(); 246 243 return ret; 247 244 } 248 245 ··· 296 291 .llseek = proc_bus_pci_lseek, 297 292 .read = proc_bus_pci_read, 298 293 .write = proc_bus_pci_write, 299 - .ioctl = proc_bus_pci_ioctl, 294 + .unlocked_ioctl = proc_bus_pci_ioctl, 300 295 #ifdef HAVE_PCI_MMAP 301 296 .open = proc_bus_pci_open, 302 297 .release = proc_bus_pci_release,