aboutsummaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2008-04-29 01:02:58 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 08:06:24 -0700
commit43ae4860ff4a358c29b9d364e45c2d09ad9fa067 (patch)
tree7095758a450557dbf6495b405d49aa1b8535fe26 /drivers/char
parent88c730da8c8b20fa732221725347bd9460842bac (diff)
random: use unlocked_ioctl
No locking actually needed. Signed-off-by: Matt Mackall <mpm@selenic.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/random.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 46944088cf9..964d78d3157 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1062,8 +1062,7 @@ static ssize_t random_write(struct file *file, const char __user *buffer,
return (ssize_t)count;
}
-static int random_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
+static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
{
int size, ent_count;
int __user *p = (int __user *)arg;
@@ -1071,8 +1070,8 @@ static int random_ioctl(struct inode *inode, struct file *file,
switch (cmd) {
case RNDGETENTCNT:
- ent_count = input_pool.entropy_count;
- if (put_user(ent_count, p))
+ /* inherently racy, no point locking */
+ if (put_user(input_pool.entropy_count, p))
return -EFAULT;
return 0;
case RNDADDTOENTCNT:
@@ -1115,13 +1114,13 @@ const struct file_operations random_fops = {
.read = random_read,
.write = random_write,
.poll = random_poll,
- .ioctl = random_ioctl,
+ .unlocked_ioctl = random_ioctl,
};
const struct file_operations urandom_fops = {
.read = urandom_read,
.write = random_write,
- .ioctl = random_ioctl,
+ .unlocked_ioctl = random_ioctl,
};
/***************************************************************