Switch Sibyte profiling driver to ->compat_ioctl
authorRalf Baechle <ralf@linux-mips.org>
Fri, 30 Sep 2005 00:51:21 +0000 (01:51 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 29 Oct 2005 18:32:29 +0000 (19:32 +0100)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/ioctl32.c
arch/mips/sibyte/sb1250/bcm1250_tbprof.c

index c069719ff0d842a89c3d9b442cb4f5cd07147ee8..ed9b2da510beb626ea443b5bc01d56c180cd0a1f 100644 (file)
@@ -41,12 +41,6 @@ IOCTL_TABLE_START
 #define DECLARES
 #include "compat_ioctl.c"
 
-#ifdef CONFIG_SIBYTE_TBPROF
-COMPATIBLE_IOCTL(SBPROF_ZBSTART)
-COMPATIBLE_IOCTL(SBPROF_ZBSTOP)
-COMPATIBLE_IOCTL(SBPROF_ZBWAITFULL)
-#endif /* CONFIG_SIBYTE_TBPROF */
-
 /*HANDLE_IOCTL(RTC_IRQP_READ, w_long)
 COMPATIBLE_IOCTL(RTC_IRQP_SET)
 HANDLE_IOCTL(RTC_EPOCH_READ, w_long)
index e4dfeb52dcec0e09af819f547c5572546b2ce2ee..992e0d8dbb67599cd10a66c95008c07759632cbb 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/fs.h>
 #include <linux/errno.h>
 #include <linux/reboot.h>
+#include <linux/smp_lock.h>
 #include <linux/wait.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -343,13 +344,13 @@ static ssize_t sbprof_tb_read(struct file *filp, char *buf,
        return count;
 }
 
-static int sbprof_tb_ioctl(struct inode *inode,
-                          struct file *filp,
-                          unsigned int command,
-                          unsigned long arg)
+static long sbprof_tb_ioctl(struct file *filp,
+                           unsigned int command,
+                           unsigned long arg)
 {
        int error = 0;
 
+       lock_kernel();
        switch (command) {
        case SBPROF_ZBSTART:
                error = sbprof_zbprof_start(filp);
@@ -368,6 +369,7 @@ static int sbprof_tb_ioctl(struct inode *inode,
                error = -EINVAL;
                break;
        }
+       unlock_kernel();
 
        return error;
 }
@@ -377,7 +379,8 @@ static struct file_operations sbprof_tb_fops = {
        .open           = sbprof_tb_open,
        .release        = sbprof_tb_release,
        .read           = sbprof_tb_read,
-       .ioctl          = sbprof_tb_ioctl,
+       .unlocked_ioctl = sbprof_tb_ioctl,
+       .compat_ioctl   = sbprof_tb_ioctl,
        .mmap           = NULL,
 };