Commit 203956f6 authored by Andi Kleen's avatar Andi Kleen Committed by David S. Miller

[NET]: Use unlocked_ioctl for sock_ioctl.

Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27a14b12
...@@ -104,7 +104,7 @@ static int sock_mmap(struct file *file, struct vm_area_struct * vma); ...@@ -104,7 +104,7 @@ static int sock_mmap(struct file *file, struct vm_area_struct * vma);
static int sock_close(struct inode *inode, struct file *file); static int sock_close(struct inode *inode, struct file *file);
static unsigned int sock_poll(struct file *file, static unsigned int sock_poll(struct file *file,
struct poll_table_struct *wait); struct poll_table_struct *wait);
static int sock_ioctl(struct inode *inode, struct file *file, static long sock_ioctl(struct file *file,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
static int sock_fasync(int fd, struct file *filp, int on); static int sock_fasync(int fd, struct file *filp, int on);
static ssize_t sock_readv(struct file *file, const struct iovec *vector, static ssize_t sock_readv(struct file *file, const struct iovec *vector,
...@@ -126,7 +126,7 @@ static struct file_operations socket_file_ops = { ...@@ -126,7 +126,7 @@ static struct file_operations socket_file_ops = {
.aio_read = sock_aio_read, .aio_read = sock_aio_read,
.aio_write = sock_aio_write, .aio_write = sock_aio_write,
.poll = sock_poll, .poll = sock_poll,
.ioctl = sock_ioctl, .unlocked_ioctl = sock_ioctl,
.mmap = sock_mmap, .mmap = sock_mmap,
.open = sock_no_open, /* special open code to disallow open via /proc */ .open = sock_no_open, /* special open code to disallow open via /proc */
.release = sock_close, .release = sock_close,
...@@ -829,15 +829,13 @@ EXPORT_SYMBOL(dlci_ioctl_set); ...@@ -829,15 +829,13 @@ EXPORT_SYMBOL(dlci_ioctl_set);
* what to do with it - that's up to the protocol still. * what to do with it - that's up to the protocol still.
*/ */
static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
unsigned long arg)
{ {
struct socket *sock; struct socket *sock;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int pid, err; int pid, err;
unlock_kernel(); sock = SOCKET_I(file->f_dentry->d_inode);
sock = SOCKET_I(inode);
if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
err = dev_ioctl(cmd, argp); err = dev_ioctl(cmd, argp);
} else } else
...@@ -903,8 +901,6 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -903,8 +901,6 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
err = sock->ops->ioctl(sock, cmd, arg); err = sock->ops->ioctl(sock, cmd, arg);
break; break;
} }
lock_kernel();
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment