public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergio Luis <sergio@uece.br>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
	linux-pci@atrey.karlin.mff.cuni.cz
Cc: kernel-janitors@vger.kernel.org
Subject: [PATCH 1/1] PCI: change procfs interface to use unlocked_ioctl instead of ioctl
Date: Fri, 11 Jan 2008 00:26:06 -0300	[thread overview]
Message-ID: <4786E1CE.4080404@uece.br> (raw)

Change drivers/pci/proc.c to use the unlocked_ioctl handler instead of
the ioctl one.

Signed-off-by: Sergio Luis <sergio@uece.br>

 proc.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 716439e..8ac5880 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -12,6 +12,7 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/capability.h>
+#include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
 #include "pci.h"
@@ -202,15 +203,17 @@ 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)
 {
+    struct inode *inode = file->f_path.dentry->d_inode;
     const struct proc_dir_entry *dp = PDE(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;
+    long ret = 0;
 
+    lock_kernel();
     switch (cmd) {
     case PCIIOC_CONTROLLER:
         ret = pci_domain_nr(dev->bus);
@@ -239,6 +242,7 @@ static int proc_bus_pci_ioctl(struct inode *inode, 
struct file *file, unsigned i
         break;
     };
 
+    unlock_kernel();
     return ret;
 }
 
@@ -291,7 +295,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,



             reply	other threads:[~2008-01-11  3:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11  3:26 Sergio Luis [this message]
2008-01-11 22:36 ` [PATCH 1/1] PCI: change procfs interface to use unlocked_ioctl instead of ioctl Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4786E1CE.4080404@uece.br \
    --to=sergio@uece.br \
    --cc=gregkh@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox