isdn: Push down BKL into ioctl functions
Push down bkl into isdn ioctl functions [fweisbec: dropped drivers/isdn/divert/divert_procfs.c as it has been pushed down in procfs branch already] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
This commit is contained in:
committed by
Frederic Weisbecker
parent
f4927c45be
commit
703c631ebb
@@ -787,8 +787,7 @@ capi_poll(struct file *file, poll_table * wait)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
capi_ioctl(struct inode *inode, struct file *file,
|
capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
unsigned int cmd, unsigned long arg)
|
|
||||||
{
|
{
|
||||||
struct capidev *cdev = file->private_data;
|
struct capidev *cdev = file->private_data;
|
||||||
capi_ioctl_struct data;
|
capi_ioctl_struct data;
|
||||||
@@ -981,6 +980,18 @@ register_out:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static long
|
||||||
|
capi_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
|
ret = capi_ioctl(file, cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static int capi_open(struct inode *inode, struct file *file)
|
static int capi_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct capidev *cdev;
|
struct capidev *cdev;
|
||||||
@@ -1026,7 +1037,7 @@ static const struct file_operations capi_fops =
|
|||||||
.read = capi_read,
|
.read = capi_read,
|
||||||
.write = capi_write,
|
.write = capi_write,
|
||||||
.poll = capi_poll,
|
.poll = capi_poll,
|
||||||
.ioctl = capi_ioctl,
|
.unlocked_ioctl = capi_unlocked_ioctl,
|
||||||
.open = capi_open,
|
.open = capi_open,
|
||||||
.release = capi_release,
|
.release = capi_release,
|
||||||
};
|
};
|
||||||
|
@@ -1272,9 +1272,9 @@ isdn_poll(struct file *file, poll_table * wait)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
|
isdn_ioctl(struct file *file, uint cmd, ulong arg)
|
||||||
{
|
{
|
||||||
uint minor = iminor(inode);
|
uint minor = iminor(file->f_path.dentry->d_inode);
|
||||||
isdn_ctrl c;
|
isdn_ctrl c;
|
||||||
int drvidx;
|
int drvidx;
|
||||||
int chidx;
|
int chidx;
|
||||||
@@ -1722,6 +1722,18 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
|
|||||||
#undef cfg
|
#undef cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static long
|
||||||
|
isdn_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
|
ret = isdn_ioctl(file, cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open the device code.
|
* Open the device code.
|
||||||
*/
|
*/
|
||||||
@@ -1838,7 +1850,7 @@ static const struct file_operations isdn_fops =
|
|||||||
.read = isdn_read,
|
.read = isdn_read,
|
||||||
.write = isdn_write,
|
.write = isdn_write,
|
||||||
.poll = isdn_poll,
|
.poll = isdn_poll,
|
||||||
.ioctl = isdn_ioctl,
|
.unlocked_ioctl = isdn_unlocked_ioctl,
|
||||||
.open = isdn_open,
|
.open = isdn_open,
|
||||||
.release = isdn_close,
|
.release = isdn_close,
|
||||||
};
|
};
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#include <linux/miscdevice.h>
|
#include <linux/miscdevice.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/mISDNif.h>
|
#include <linux/mISDNif.h>
|
||||||
|
#include <linux/smp_lock.h>
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
static u_int *debug;
|
static u_int *debug;
|
||||||
@@ -215,9 +216,8 @@ unlock:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static long
|
||||||
mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
|
mISDN_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
|
||||||
unsigned long arg)
|
|
||||||
{
|
{
|
||||||
struct mISDNtimerdev *dev = filep->private_data;
|
struct mISDNtimerdev *dev = filep->private_data;
|
||||||
int id, tout, ret = 0;
|
int id, tout, ret = 0;
|
||||||
@@ -226,6 +226,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
|
|||||||
if (*debug & DEBUG_TIMER)
|
if (*debug & DEBUG_TIMER)
|
||||||
printk(KERN_DEBUG "%s(%p, %x, %lx)\n", __func__,
|
printk(KERN_DEBUG "%s(%p, %x, %lx)\n", __func__,
|
||||||
filep, cmd, arg);
|
filep, cmd, arg);
|
||||||
|
lock_kernel();
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case IMADDTIMER:
|
case IMADDTIMER:
|
||||||
if (get_user(tout, (int __user *)arg)) {
|
if (get_user(tout, (int __user *)arg)) {
|
||||||
@@ -257,13 +258,14 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
|
|||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
}
|
}
|
||||||
|
unlock_kernel();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations mISDN_fops = {
|
static const struct file_operations mISDN_fops = {
|
||||||
.read = mISDN_read,
|
.read = mISDN_read,
|
||||||
.poll = mISDN_poll,
|
.poll = mISDN_poll,
|
||||||
.ioctl = mISDN_ioctl,
|
.unlocked_ioctl = mISDN_ioctl,
|
||||||
.open = mISDN_open,
|
.open = mISDN_open,
|
||||||
.release = mISDN_close,
|
.release = mISDN_close,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user