Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=add771840be591fd926a5ca27c22e622c13d1294
Commit:     add771840be591fd926a5ca27c22e622c13d1294
Parent:     2326e2b99969e69fedc92de80d80b2d2f92fd942
Author:     Mathieu Segaud <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 14:27:12 2008 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 15:04:29 2008 -0800

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/pci/proc.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 48ca9ae..2bf159b 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#include <linux/smp_lock.h>
 #include <linux/capability.h>
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
@@ -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 inode *inode, struct 
file *file, unsigned i
                break;
        };
 
+       unlock_kernel();
        return ret;
 }
 
@@ -291,7 +296,7 @@ static const struct file_operations proc_bus_pci_operations 
= {
        .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,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to