Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192259
b: refs/heads/master
c: d79b6f4
h: refs/heads/master
i:
  192257: b03a16e
  192255: 9546a77
v: v3
  • Loading branch information
Frederic Weisbecker committed May 17, 2010
1 parent fbd2dec commit 0b81b32
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73296bc611cee009f3be6b451e827d1425b9c10f
refs/heads/master: d79b6f4de5db0103ceb4734e42ad101d836d61d9
21 changes: 16 additions & 5 deletions trunk/drivers/char/i8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/seq_file.h>
#include <linux/dmi.h>
#include <linux/capability.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/io.h>

Expand Down Expand Up @@ -82,16 +83,15 @@ module_param(fan_mult, int, 0);
MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with");

static int i8k_open_fs(struct inode *inode, struct file *file);
static int i8k_ioctl(struct inode *, struct file *, unsigned int,
unsigned long);
static long i8k_ioctl(struct file *, unsigned int, unsigned long);

static const struct file_operations i8k_fops = {
.owner = THIS_MODULE,
.open = i8k_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.ioctl = i8k_ioctl,
.unlocked_ioctl = i8k_ioctl,
};

struct smm_regs {
Expand Down Expand Up @@ -307,8 +307,8 @@ static int i8k_get_dell_signature(int req_fn)
return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1;
}

static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
unsigned long arg)
static int
i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
{
int val = 0;
int speed;
Expand Down Expand Up @@ -395,6 +395,17 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
return 0;
}

static long i8k_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
{
long ret;

lock_kernel();
ret = i8k_ioctl_unlocked(fp, cmd, arg);
unlock_kernel();

return ret;
}

/*
* Print the information for /proc/i8k.
*/
Expand Down
18 changes: 14 additions & 4 deletions trunk/drivers/isdn/divert/divert_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/sched.h>
#include <linux/isdnif.h>
#include <net/net_namespace.h>
#include <linux/smp_lock.h>
#include "isdn_divert.h"


Expand Down Expand Up @@ -176,9 +177,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
/*********/
/* 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;
int i;
Expand Down Expand Up @@ -257,14 +256,25 @@ isdn_divert_ioctl(struct inode *inode, struct file *file,
return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
} /* 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 =
{
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = isdn_divert_read,
.write = isdn_divert_write,
.poll = isdn_divert_poll,
.ioctl = isdn_divert_ioctl,
.unlocked_ioctl = isdn_divert_ioctl,
.open = isdn_divert_open,
.release = isdn_divert_close,
};
Expand Down
14 changes: 10 additions & 4 deletions trunk/net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,12 +1331,18 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
return cache_poll(filp, wait, cd);
}

static int cache_ioctl_procfs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
static long cache_ioctl_procfs(struct file *filp,
unsigned int cmd, unsigned long arg)
{
long ret;
struct inode *inode = filp->f_path.dentry->d_inode;
struct cache_detail *cd = PDE(inode)->data;

return cache_ioctl(inode, filp, cmd, arg, cd);
lock_kernel();
ret = cache_ioctl(inode, filp, cmd, arg, cd);
unlock_kernel();

return ret;
}

static int cache_open_procfs(struct inode *inode, struct file *filp)
Expand All @@ -1359,7 +1365,7 @@ static const struct file_operations cache_file_operations_procfs = {
.read = cache_read_procfs,
.write = cache_write_procfs,
.poll = cache_poll_procfs,
.ioctl = cache_ioctl_procfs, /* for FIONREAD */
.unlocked_ioctl = cache_ioctl_procfs, /* for FIONREAD */
.open = cache_open_procfs,
.release = cache_release_procfs,
};
Expand Down

0 comments on commit 0b81b32

Please sign in to comment.