aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/random.c
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2008-04-29 04:02:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:24 -0400
commit43ae4860ff4a358c29b9d364e45c2d09ad9fa067 (patch)
tree7095758a450557dbf6495b405d49aa1b8535fe26 /drivers/char/random.c
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/random.c')
-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 46944088cf94..964d78d31578 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,
1062 return (ssize_t)count; 1062 return (ssize_t)count;
1063} 1063}
1064 1064
1065static int random_ioctl(struct inode *inode, struct file *file, 1065static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
1066 unsigned int cmd, unsigned long arg)
1067{ 1066{
1068 int size, ent_count; 1067 int size, ent_count;
1069 int __user *p = (int __user *)arg; 1068 int __user *p = (int __user *)arg;
@@ -1071,8 +1070,8 @@ static int random_ioctl(struct inode *inode, struct file *file,
1071 1070
1072 switch (cmd) { 1071 switch (cmd) {
1073 case RNDGETENTCNT: 1072 case RNDGETENTCNT:
1074 ent_count = input_pool.entropy_count; 1073 /* inherently racy, no point locking */
1075 if (put_user(ent_count, p)) 1074 if (put_user(input_pool.entropy_count, p))
1076 return -EFAULT; 1075 return -EFAULT;
1077 return 0; 1076 return 0;
1078 case RNDADDTOENTCNT: 1077 case RNDADDTOENTCNT:
@@ -1115,13 +1114,13 @@ const struct file_operations random_fops = {
1115 .read = random_read, 1114 .read = random_read,
1116 .write = random_write, 1115 .write = random_write,
1117 .poll = random_poll, 1116 .poll = random_poll,
1118 .ioctl = random_ioctl, 1117 .unlocked_ioctl = random_ioctl,
1119}; 1118};
1120 1119
1121const struct file_operations urandom_fops = { 1120const struct file_operations urandom_fops = {
1122 .read = urandom_read, 1121 .read = urandom_read,
1123 .write = random_write, 1122 .write = random_write,
1124 .ioctl = random_ioctl, 1123 .unlocked_ioctl = random_ioctl,
1125}; 1124};
1126 1125
1127/*************************************************************** 1126/***************************************************************