From mathieu.segaud@regala.cx Fri Jan 11 14:34:23 2008 From: Mathieu Segaud Date: Thu, 10 Jan 2008 14:27:12 +0100 Subject: PCI: Convert drivers/pci/proc.c to use unlocked_ioctl To: gregkh@suse.de Cc: linux-pci@atrey.karlin.mff.cuni.cz, Mathieu Segaud Message-ID: <1199971632-19797-1-git-send-email-mathieu.segaud@regala.cx> Change access to inode thru file->f_dentry->d_inode, and add explicit lock/unlock_kernel() calls. Signed-off-by: Mathieu Segaud Signed-off-by: Greg Kroah-Hartman --- drivers/pci/proc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -202,15 +203,18 @@ struct pci_filp_private { int write_combine; }; -static int proc_bus_pci_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) { - const struct proc_dir_entry *dp = PDE(inode); + const struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); struct pci_dev *dev = dp->data; #ifdef HAVE_PCI_MMAP struct pci_filp_private *fpriv = file->private_data; #endif /* HAVE_PCI_MMAP */ int ret = 0; + lock_kernel(); + switch (cmd) { case PCIIOC_CONTROLLER: ret = pci_domain_nr(dev->bus); @@ -239,6 +243,7 @@ static int proc_bus_pci_ioctl(struct ino break; }; + unlock_kernel(); return ret; } @@ -291,7 +296,7 @@ static const struct file_operations proc .llseek = proc_bus_pci_lseek, .read = proc_bus_pci_read, .write = proc_bus_pci_write, - .ioctl = proc_bus_pci_ioctl, + .unlocked_ioctl = proc_bus_pci_ioctl, #ifdef HAVE_PCI_MMAP .open = proc_bus_pci_open, .release = proc_bus_pci_release,