|
@@ -19,6 +19,7 @@
|
|
#include <linux/sched.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/isdnif.h>
|
|
#include <linux/isdnif.h>
|
|
#include <net/net_namespace.h>
|
|
#include <net/net_namespace.h>
|
|
|
|
+#include <linux/smp_lock.h>
|
|
#include "isdn_divert.h"
|
|
#include "isdn_divert.h"
|
|
|
|
|
|
|
|
|
|
@@ -176,9 +177,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
|
|
/*********/
|
|
/*********/
|
|
/* IOCTL */
|
|
/* IOCTL */
|
|
/*********/
|
|
/*********/
|
|
-static int
|
|
|
|
-isdn_divert_ioctl(struct inode *inode, struct file *file,
|
|
|
|
- uint cmd, ulong arg)
|
|
|
|
|
|
+static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg)
|
|
{
|
|
{
|
|
divert_ioctl dioctl;
|
|
divert_ioctl dioctl;
|
|
int i;
|
|
int i;
|
|
@@ -257,6 +256,17 @@ isdn_divert_ioctl(struct inode *inode, struct file *file,
|
|
return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
|
|
return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
|
|
} /* isdn_divert_ioctl */
|
|
} /* isdn_divert_ioctl */
|
|
|
|
|
|
|
|
+static long isdn_divert_ioctl(struct file *file, uint cmd, ulong arg)
|
|
|
|
+{
|
|
|
|
+ long ret;
|
|
|
|
+
|
|
|
|
+ lock_kernel();
|
|
|
|
+ ret = isdn_divert_ioctl_unlocked(file, cmd, arg);
|
|
|
|
+ unlock_kernel();
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
static const struct file_operations isdn_fops =
|
|
static const struct file_operations isdn_fops =
|
|
{
|
|
{
|
|
.owner = THIS_MODULE,
|
|
.owner = THIS_MODULE,
|
|
@@ -264,7 +274,7 @@ static const struct file_operations isdn_fops =
|
|
.read = isdn_divert_read,
|
|
.read = isdn_divert_read,
|
|
.write = isdn_divert_write,
|
|
.write = isdn_divert_write,
|
|
.poll = isdn_divert_poll,
|
|
.poll = isdn_divert_poll,
|
|
- .ioctl = isdn_divert_ioctl,
|
|
|
|
|
|
+ .unlocked_ioctl = isdn_divert_ioctl,
|
|
.open = isdn_divert_open,
|
|
.open = isdn_divert_open,
|
|
.release = isdn_divert_close,
|
|
.release = isdn_divert_close,
|
|
};
|
|
};
|