lkml.org 
[lkml]   [2008]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Random number driver: make random_ioctl as an unlocked_ioctl function
From
Date
The random_ioctl is registered as an ioctl function but it does not
require BKL to be held when called. Changing it as an unlocked_ioctl
function.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

---
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 5fee056..2446e14 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1065,9 +1065,8 @@ 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 * file, unsigned int cmd, unsigned long arg)
{
int size, ent_count;
int __user *p = (int __user *)arg;
@@ -1131,13 +1130,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,
};

/***************************************************************



\
 
 \ /
  Last update: 2008-01-11 12:39    [W:0.798 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site