You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing: uml: Pushdown the bkl from harddog_kern ioctl sunrpc: Pushdown the bkl from sunrpc cache ioctl sunrpc: Pushdown the bkl from ioctl autofs4: Pushdown the bkl from ioctl uml: Convert to unlocked_ioctls to remove implicit BKL ncpfs: BKL ioctl pushdown coda: Clean-up whitespace problems in pioctl.c coda: BKL ioctl pushdown drivers: Push down BKL into various drivers isdn: Push down BKL into ioctl functions scsi: Push down BKL into ioctl functions dvb: Push down BKL into ioctl functions smbfs: Push down BKL into ioctl function coda/psdev: Remove BKL from ioctl function um/mmapper: Remove BKL usage sn_hwperf: Kill BKL usage hfsplus: Push down BKL into ioctl function
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/cpumask.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/nodemask.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/mutex.h>
|
||||
@@ -682,8 +681,7 @@ static int sn_hwperf_map_err(int hwperf_err)
|
||||
/*
|
||||
* ioctl for "sn_hwperf" misc device
|
||||
*/
|
||||
static int
|
||||
sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, unsigned long arg)
|
||||
static long sn_hwperf_ioctl(struct file *fp, u32 op, unsigned long arg)
|
||||
{
|
||||
struct sn_hwperf_ioctl_args a;
|
||||
struct cpuinfo_ia64 *cdata;
|
||||
@@ -699,8 +697,6 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, unsigned long arg)
|
||||
int i;
|
||||
int j;
|
||||
|
||||
unlock_kernel();
|
||||
|
||||
/* only user requests are allowed here */
|
||||
if ((op & SN_HWPERF_OP_MASK) < 10) {
|
||||
r = -EINVAL;
|
||||
@@ -859,12 +855,11 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, unsigned long arg)
|
||||
error:
|
||||
vfree(p);
|
||||
|
||||
lock_kernel();
|
||||
return r;
|
||||
}
|
||||
|
||||
static const struct file_operations sn_hwperf_fops = {
|
||||
.ioctl = sn_hwperf_ioctl,
|
||||
.unlocked_ioctl = sn_hwperf_ioctl,
|
||||
};
|
||||
|
||||
static struct miscdevice sn_hwperf_dev = {
|
||||
|
||||
@@ -124,7 +124,7 @@ static ssize_t harddog_write(struct file *file, const char __user *data, size_t
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int harddog_ioctl(struct inode *inode, struct file *file,
|
||||
static int harddog_ioctl_unlocked(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
void __user *argp= (void __user *)arg;
|
||||
@@ -148,10 +148,22 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
|
||||
}
|
||||
}
|
||||
|
||||
static long harddog_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
long ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = harddog_ioctl_unlocked(file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations harddog_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.write = harddog_write,
|
||||
.ioctl = harddog_ioctl,
|
||||
.unlocked_ioctl = harddog_ioctl,
|
||||
.open = harddog_open,
|
||||
.release = harddog_release,
|
||||
};
|
||||
|
||||
@@ -136,7 +136,7 @@ static unsigned int hostaudio_poll(struct file *file,
|
||||
return mask;
|
||||
}
|
||||
|
||||
static int hostaudio_ioctl(struct inode *inode, struct file *file,
|
||||
static long hostaudio_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct hostaudio_state *state = file->private_data;
|
||||
@@ -223,7 +223,7 @@ static int hostaudio_release(struct inode *inode, struct file *file)
|
||||
|
||||
/* /dev/mixer file operations */
|
||||
|
||||
static int hostmixer_ioctl_mixdev(struct inode *inode, struct file *file,
|
||||
static long hostmixer_ioctl_mixdev(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct hostmixer_state *state = file->private_data;
|
||||
@@ -289,7 +289,7 @@ static const struct file_operations hostaudio_fops = {
|
||||
.read = hostaudio_read,
|
||||
.write = hostaudio_write,
|
||||
.poll = hostaudio_poll,
|
||||
.ioctl = hostaudio_ioctl,
|
||||
.unlocked_ioctl = hostaudio_ioctl,
|
||||
.mmap = NULL,
|
||||
.open = hostaudio_open,
|
||||
.release = hostaudio_release,
|
||||
@@ -298,7 +298,7 @@ static const struct file_operations hostaudio_fops = {
|
||||
static const struct file_operations hostmixer_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.ioctl = hostmixer_ioctl_mixdev,
|
||||
.unlocked_ioctl = hostmixer_ioctl_mixdev,
|
||||
.open = hostmixer_open_mixdev,
|
||||
.release = hostmixer_release,
|
||||
};
|
||||
|
||||
@@ -46,8 +46,7 @@ static ssize_t mmapper_write(struct file *file, const char __user *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int mmapper_ioctl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
return -ENOIOCTLCMD;
|
||||
}
|
||||
@@ -90,7 +89,7 @@ static const struct file_operations mmapper_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = mmapper_read,
|
||||
.write = mmapper_write,
|
||||
.ioctl = mmapper_ioctl,
|
||||
.unlocked_ioctl = mmapper_ioctl,
|
||||
.mmap = mmapper_mmap,
|
||||
.open = mmapper_open,
|
||||
.release = mmapper_release,
|
||||
|
||||
@@ -265,8 +265,8 @@ static unsigned int apm_poll(struct file *fp, poll_table * wait)
|
||||
* Only when everyone who has opened /dev/apm_bios with write permission
|
||||
* has acknowledge does the actual suspend happen.
|
||||
*/
|
||||
static int
|
||||
apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
|
||||
static long
|
||||
apm_ioctl(struct file *filp, u_int cmd, u_long arg)
|
||||
{
|
||||
struct apm_user *as = filp->private_data;
|
||||
int err = -EINVAL;
|
||||
@@ -274,6 +274,7 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
|
||||
if (!as->suser || !as->writer)
|
||||
return -EPERM;
|
||||
|
||||
lock_kernel();
|
||||
switch (cmd) {
|
||||
case APM_IOC_SUSPEND:
|
||||
mutex_lock(&state_lock);
|
||||
@@ -334,6 +335,7 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
|
||||
mutex_unlock(&state_lock);
|
||||
break;
|
||||
}
|
||||
unlock_kernel();
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -397,7 +399,7 @@ static const struct file_operations apm_bios_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = apm_read,
|
||||
.poll = apm_poll,
|
||||
.ioctl = apm_ioctl,
|
||||
.unlocked_ioctl = apm_ioctl,
|
||||
.open = apm_open,
|
||||
.release = apm_release,
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/wait.h>
|
||||
@@ -106,8 +107,7 @@ static unsigned int DeviceErrorCount; /* number of device error */
|
||||
|
||||
static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *);
|
||||
static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *);
|
||||
static int ac_ioctl(struct inode *, struct file *, unsigned int,
|
||||
unsigned long);
|
||||
static long ac_ioctl(struct file *, unsigned int, unsigned long);
|
||||
static irqreturn_t ac_interrupt(int, void *);
|
||||
|
||||
static const struct file_operations ac_fops = {
|
||||
@@ -115,7 +115,7 @@ static const struct file_operations ac_fops = {
|
||||
.llseek = no_llseek,
|
||||
.read = ac_read,
|
||||
.write = ac_write,
|
||||
.ioctl = ac_ioctl,
|
||||
.unlocked_ioctl = ac_ioctl,
|
||||
};
|
||||
|
||||
static struct miscdevice ac_miscdev = {
|
||||
@@ -689,7 +689,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance)
|
||||
|
||||
|
||||
|
||||
static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
|
||||
static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
|
||||
{ /* @ ADG ou ATO selon le cas */
|
||||
int i;
|
||||
@@ -712,6 +712,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
lock_kernel();
|
||||
IndexCard = adgl->num_card-1;
|
||||
|
||||
if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) {
|
||||
@@ -721,6 +722,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
|
||||
warncount--;
|
||||
}
|
||||
kfree(adgl);
|
||||
unlock_kernel();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -838,6 +840,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
|
||||
}
|
||||
Dummy = readb(apbs[IndexCard].RamIO + VERS);
|
||||
kfree(adgl);
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+14
-2
@@ -232,7 +232,7 @@ ds1620_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
|
||||
}
|
||||
|
||||
static int
|
||||
ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
|
||||
ds1620_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct therm therm;
|
||||
union {
|
||||
@@ -316,6 +316,18 @@ ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long
|
||||
ds1620_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = ds1620_ioctl(file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef THERM_USE_PROC
|
||||
static int
|
||||
proc_therm_ds1620_read(char *buf, char **start, off_t offset,
|
||||
@@ -344,7 +356,7 @@ static const struct file_operations ds1620_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = ds1620_open,
|
||||
.read = ds1620_read,
|
||||
.ioctl = ds1620_ioctl,
|
||||
.unlocked_ioctl = ds1620_unlocked_ioctl,
|
||||
};
|
||||
|
||||
static struct miscdevice ds1620_miscdev = {
|
||||
|
||||
+5
-4
@@ -93,7 +93,7 @@ static ssize_t dtlk_write(struct file *, const char __user *,
|
||||
static unsigned int dtlk_poll(struct file *, poll_table *);
|
||||
static int dtlk_open(struct inode *, struct file *);
|
||||
static int dtlk_release(struct inode *, struct file *);
|
||||
static int dtlk_ioctl(struct inode *inode, struct file *file,
|
||||
static long dtlk_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg);
|
||||
|
||||
static const struct file_operations dtlk_fops =
|
||||
@@ -102,7 +102,7 @@ static const struct file_operations dtlk_fops =
|
||||
.read = dtlk_read,
|
||||
.write = dtlk_write,
|
||||
.poll = dtlk_poll,
|
||||
.ioctl = dtlk_ioctl,
|
||||
.unlocked_ioctl = dtlk_ioctl,
|
||||
.open = dtlk_open,
|
||||
.release = dtlk_release,
|
||||
};
|
||||
@@ -263,8 +263,7 @@ static void dtlk_timer_tick(unsigned long data)
|
||||
wake_up_interruptible(&dtlk_process_list);
|
||||
}
|
||||
|
||||
static int dtlk_ioctl(struct inode *inode,
|
||||
struct file *file,
|
||||
static long dtlk_ioctl(struct file *file,
|
||||
unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
@@ -276,7 +275,9 @@ static int dtlk_ioctl(struct inode *inode,
|
||||
switch (cmd) {
|
||||
|
||||
case DTLK_INTERROGATE:
|
||||
lock_kernel();
|
||||
sp = dtlk_interrogate();
|
||||
unlock_kernel();
|
||||
if (copy_to_user(argp, sp, sizeof(struct dtlk_settings)))
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/nvram.h>
|
||||
#ifdef CONFIG_PPC_PMAC
|
||||
@@ -84,8 +85,7 @@ static ssize_t write_nvram(struct file *file, const char __user *buf,
|
||||
return p - buf;
|
||||
}
|
||||
|
||||
static int nvram_ioctl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
switch(cmd) {
|
||||
#ifdef CONFIG_PPC_PMAC
|
||||
@@ -116,12 +116,23 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long nvram_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = nvram_ioctl(file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const struct file_operations nvram_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = nvram_llseek,
|
||||
.read = read_nvram,
|
||||
.write = write_nvram,
|
||||
.ioctl = nvram_ioctl,
|
||||
.unlocked_ioctl = nvram_unlocked_ioctl,
|
||||
};
|
||||
|
||||
static struct miscdevice nvram_dev = {
|
||||
|
||||
+14
-2
@@ -262,7 +262,7 @@ static inline int gen_set_rtc_irq_bit(unsigned char bit)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int gen_rtc_ioctl(struct inode *inode, struct file *file,
|
||||
static int gen_rtc_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct rtc_time wtime;
|
||||
@@ -332,6 +332,18 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static long gen_rtc_unlocked_ioctl(struct file *file, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = gen_rtc_ioctl(file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* We enforce only one user at a time here with the open/close.
|
||||
* Also clear the previous interrupt data on an open, and clean
|
||||
@@ -482,7 +494,7 @@ static const struct file_operations gen_rtc_fops = {
|
||||
.read = gen_rtc_read,
|
||||
.poll = gen_rtc_poll,
|
||||
#endif
|
||||
.ioctl = gen_rtc_ioctl,
|
||||
.unlocked_ioctl = gen_rtc_unlocked_ioctl,
|
||||
.open = gen_rtc_open,
|
||||
.release = gen_rtc_release,
|
||||
};
|
||||
|
||||
+8
-4
@@ -431,14 +431,18 @@ static int hpet_release(struct inode *inode, struct file *file)
|
||||
|
||||
static int hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int);
|
||||
|
||||
static int
|
||||
hpet_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
|
||||
static long hpet_ioctl(struct file *file, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
struct hpet_dev *devp;
|
||||
int ret;
|
||||
|
||||
devp = file->private_data;
|
||||
return hpet_ioctl_common(devp, cmd, arg, 0);
|
||||
lock_kernel();
|
||||
ret = hpet_ioctl_common(devp, cmd, arg, 0);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hpet_ioctl_ieon(struct hpet_dev *devp)
|
||||
@@ -654,7 +658,7 @@ static const struct file_operations hpet_fops = {
|
||||
.llseek = no_llseek,
|
||||
.read = hpet_read,
|
||||
.poll = hpet_poll,
|
||||
.ioctl = hpet_ioctl,
|
||||
.unlocked_ioctl = hpet_ioctl,
|
||||
.open = hpet_open,
|
||||
.release = hpet_release,
|
||||
.fasync = hpet_fasync,
|
||||
|
||||
@@ -228,8 +228,7 @@ static int handle_send_req(ipmi_user_t user,
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int ipmi_ioctl(struct inode *inode,
|
||||
struct file *file,
|
||||
static int ipmi_ioctl(struct file *file,
|
||||
unsigned int cmd,
|
||||
unsigned long data)
|
||||
{
|
||||
@@ -630,6 +629,23 @@ static int ipmi_ioctl(struct inode *inode,
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: it doesn't make sense to take the BKL here but
|
||||
* not in compat_ipmi_ioctl. -arnd
|
||||
*/
|
||||
static long ipmi_unlocked_ioctl(struct file *file,
|
||||
unsigned int cmd,
|
||||
unsigned long data)
|
||||
{
|
||||
int ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = ipmi_ioctl(file, cmd, data);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
/*
|
||||
@@ -802,7 +818,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
|
||||
if (copy_to_user(precv64, &recv64, sizeof(recv64)))
|
||||
return -EFAULT;
|
||||
|
||||
rc = ipmi_ioctl(filep->f_path.dentry->d_inode, filep,
|
||||
rc = ipmi_ioctl(filep,
|
||||
((cmd == COMPAT_IPMICTL_RECEIVE_MSG)
|
||||
? IPMICTL_RECEIVE_MSG
|
||||
: IPMICTL_RECEIVE_MSG_TRUNC),
|
||||
@@ -819,14 +835,14 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
|
||||
return rc;
|
||||
}
|
||||
default:
|
||||
return ipmi_ioctl(filep->f_path.dentry->d_inode, filep, cmd, arg);
|
||||
return ipmi_ioctl(filep, cmd, arg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct file_operations ipmi_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = ipmi_ioctl,
|
||||
.unlocked_ioctl = ipmi_unlocked_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = compat_ipmi_ioctl,
|
||||
#endif
|
||||
|
||||
@@ -659,7 +659,7 @@ static struct watchdog_info ident = {
|
||||
.identity = "IPMI"
|
||||
};
|
||||
|
||||
static int ipmi_ioctl(struct inode *inode, struct file *file,
|
||||
static int ipmi_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
void __user *argp = (void __user *)arg;
|
||||
@@ -730,6 +730,19 @@ static int ipmi_ioctl(struct inode *inode, struct file *file,
|
||||
}
|
||||
}
|
||||
|
||||
static long ipmi_unlocked_ioctl(struct file *file,
|
||||
unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = ipmi_ioctl(file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t ipmi_write(struct file *file,
|
||||
const char __user *buf,
|
||||
size_t len,
|
||||
@@ -880,7 +893,7 @@ static const struct file_operations ipmi_wdog_fops = {
|
||||
.read = ipmi_read,
|
||||
.poll = ipmi_poll,
|
||||
.write = ipmi_write,
|
||||
.ioctl = ipmi_ioctl,
|
||||
.unlocked_ioctl = ipmi_unlocked_ioctl,
|
||||
.open = ipmi_open,
|
||||
.release = ipmi_close,
|
||||
.fasync = ipmi_fasync,
|
||||
|
||||
@@ -296,8 +296,8 @@ checksum_err:
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
static int nvram_ioctl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
static long nvram_ioctl(struct file *file, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -308,6 +308,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EACCES;
|
||||
|
||||
lock_kernel();
|
||||
spin_lock_irq(&rtc_lock);
|
||||
|
||||
for (i = 0; i < NVRAM_BYTES; ++i)
|
||||
@@ -315,6 +316,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
|
||||
__nvram_set_checksum();
|
||||
|
||||
spin_unlock_irq(&rtc_lock);
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
|
||||
case NVRAM_SETCKS:
|
||||
@@ -323,9 +325,11 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EACCES;
|
||||
|
||||
lock_kernel();
|
||||
spin_lock_irq(&rtc_lock);
|
||||
__nvram_set_checksum();
|
||||
spin_unlock_irq(&rtc_lock);
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
|
||||
default:
|
||||
@@ -422,7 +426,7 @@ static const struct file_operations nvram_fops = {
|
||||
.llseek = nvram_llseek,
|
||||
.read = nvram_read,
|
||||
.write = nvram_write,
|
||||
.ioctl = nvram_ioctl,
|
||||
.unlocked_ioctl = nvram_ioctl,
|
||||
.open = nvram_open,
|
||||
.release = nvram_release,
|
||||
};
|
||||
|
||||
@@ -94,8 +94,9 @@ static int get_flash_id(void)
|
||||
return c2;
|
||||
}
|
||||
|
||||
static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cmd, unsigned long arg)
|
||||
static long flash_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
lock_kernel();
|
||||
switch (cmd) {
|
||||
case CMD_WRITE_DISABLE:
|
||||
gbWriteBase64Enable = 0;
|
||||
@@ -113,8 +114,10 @@ static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cm
|
||||
default:
|
||||
gbWriteBase64Enable = 0;
|
||||
gbWriteEnable = 0;
|
||||
unlock_kernel();
|
||||
return -EINVAL;
|
||||
}
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -631,7 +634,7 @@ static const struct file_operations flash_fops =
|
||||
.llseek = flash_llseek,
|
||||
.read = flash_read,
|
||||
.write = flash_write,
|
||||
.ioctl = flash_ioctl,
|
||||
.unlocked_ioctl = flash_ioctl,
|
||||
};
|
||||
|
||||
static struct miscdevice flash_miscdev =
|
||||
|
||||
+15
-9
@@ -121,13 +121,17 @@ static int raw_release(struct inode *inode, struct file *filp)
|
||||
/*
|
||||
* Forward ioctls to the underlying block device.
|
||||
*/
|
||||
static int
|
||||
raw_ioctl(struct inode *inode, struct file *filp,
|
||||
unsigned int command, unsigned long arg)
|
||||
static long
|
||||
raw_ioctl(struct file *filp, unsigned int command, unsigned long arg)
|
||||
{
|
||||
struct block_device *bdev = filp->private_data;
|
||||
int ret;
|
||||
|
||||
return blkdev_ioctl(bdev, 0, command, arg);
|
||||
lock_kernel();
|
||||
ret = blkdev_ioctl(bdev, 0, command, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void bind_device(struct raw_config_request *rq)
|
||||
@@ -141,13 +145,14 @@ static void bind_device(struct raw_config_request *rq)
|
||||
* Deal with ioctls against the raw-device control interface, to bind
|
||||
* and unbind other raw devices.
|
||||
*/
|
||||
static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
|
||||
unsigned int command, unsigned long arg)
|
||||
static long raw_ctl_ioctl(struct file *filp, unsigned int command,
|
||||
unsigned long arg)
|
||||
{
|
||||
struct raw_config_request rq;
|
||||
struct raw_device_data *rawdev;
|
||||
int err = 0;
|
||||
|
||||
lock_kernel();
|
||||
switch (command) {
|
||||
case RAW_SETBIND:
|
||||
case RAW_GETBIND:
|
||||
@@ -240,6 +245,7 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
|
||||
break;
|
||||
}
|
||||
out:
|
||||
unlock_kernel();
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -250,13 +256,13 @@ static const struct file_operations raw_fops = {
|
||||
.aio_write = blkdev_aio_write,
|
||||
.fsync = blkdev_fsync,
|
||||
.open = raw_open,
|
||||
.release= raw_release,
|
||||
.ioctl = raw_ioctl,
|
||||
.release = raw_release,
|
||||
.unlocked_ioctl = raw_ioctl,
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
static const struct file_operations raw_ctl_fops = {
|
||||
.ioctl = raw_ctl_ioctl,
|
||||
.unlocked_ioctl = raw_ctl_ioctl,
|
||||
.open = raw_open,
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/hwmon.h>
|
||||
#include <linux/hwmon-sysfs.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/sysfs.h>
|
||||
@@ -847,8 +848,7 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int watchdog_ioctl(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
static long watchdog_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
static struct watchdog_info ident = {
|
||||
.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
|
||||
@@ -858,6 +858,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp,
|
||||
int i, ret = 0;
|
||||
struct fschmd_data *data = filp->private_data;
|
||||
|
||||
lock_kernel();
|
||||
switch (cmd) {
|
||||
case WDIOC_GETSUPPORT:
|
||||
ident.firmware_version = data->revision;
|
||||
@@ -914,7 +915,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp,
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
}
|
||||
|
||||
unlock_kernel();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -924,7 +925,7 @@ static const struct file_operations watchdog_fops = {
|
||||
.open = watchdog_open,
|
||||
.release = watchdog_release,
|
||||
.write = watchdog_write,
|
||||
.ioctl = watchdog_ioctl,
|
||||
.unlocked_ioctl = watchdog_ioctl,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/hwmon.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/hwmon-vid.h>
|
||||
#include <linux/hwmon-sysfs.h>
|
||||
#include <linux/err.h>
|
||||
@@ -1319,8 +1320,8 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int watchdog_ioctl(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
static long watchdog_ioctl(struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
static struct watchdog_info ident = {
|
||||
.options = WDIOF_KEEPALIVEPING |
|
||||
@@ -1332,6 +1333,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp,
|
||||
int val, ret = 0;
|
||||
struct w83793_data *data = filp->private_data;
|
||||
|
||||
lock_kernel();
|
||||
switch (cmd) {
|
||||
case WDIOC_GETSUPPORT:
|
||||
if (!nowayout)
|
||||
@@ -1385,7 +1387,7 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp,
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
}
|
||||
|
||||
unlock_kernel();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1395,7 +1397,7 @@ static const struct file_operations watchdog_fops = {
|
||||
.open = watchdog_open,
|
||||
.release = watchdog_close,
|
||||
.write = watchdog_write,
|
||||
.ioctl = watchdog_ioctl,
|
||||
.unlocked_ioctl = watchdog_ioctl,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/semaphore.h>
|
||||
|
||||
MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>");
|
||||
@@ -64,7 +65,7 @@ static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait);
|
||||
static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
|
||||
size_t count, loff_t *ppos);
|
||||
|
||||
static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
|
||||
static long hp_sdc_rtc_unlocked_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg);
|
||||
|
||||
static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait);
|
||||
@@ -512,7 +513,7 @@ static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off,
|
||||
return len;
|
||||
}
|
||||
|
||||
static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
|
||||
static int hp_sdc_rtc_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
#if 1
|
||||
@@ -659,12 +660,25 @@ static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
|
||||
#endif
|
||||
}
|
||||
|
||||
static long hp_sdc_rtc_unlocked_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
lock_kernel();
|
||||
ret = hp_sdc_rtc_ioctl(file, cmd, arg);
|
||||
unlock_kernel();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static const struct file_operations hp_sdc_rtc_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.read = hp_sdc_rtc_read,
|
||||
.poll = hp_sdc_rtc_poll,
|
||||
.ioctl = hp_sdc_rtc_ioctl,
|
||||
.unlocked_ioctl = hp_sdc_rtc_ioctl,
|
||||
.open = hp_sdc_rtc_open,
|
||||
.fasync = hp_sdc_rtc_fasync,
|
||||
};
|
||||
|
||||
@@ -787,8 +787,7 @@ capi_poll(struct file *file, poll_table * wait)
|
||||
}
|
||||
|
||||
static int
|
||||
capi_ioctl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct capidev *cdev = file->private_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)
|
||||
{
|
||||
struct capidev *cdev;
|
||||
@@ -1026,7 +1037,7 @@ static const struct file_operations capi_fops =
|
||||
.read = capi_read,
|
||||
.write = capi_write,
|
||||
.poll = capi_poll,
|
||||
.ioctl = capi_ioctl,
|
||||
.unlocked_ioctl = capi_unlocked_ioctl,
|
||||
.open = capi_open,
|
||||
.release = capi_release,
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user