[AIO] remove incomplete aio methods from networking file_operations Networking doesn't fully support aio just yet, so remove the aio methods from its file descriptor to allow the fallback code paths to work. Signed-off-by: Benjamin LaHaise diff -purN --exclude=description 79_fix-io_wait/net/socket.c 80_no_net_aio/net/socket.c --- 79_fix-io_wait/net/socket.c 2005-08-10 12:18:51.000000000 -0400 +++ 80_no_net_aio/net/socket.c 2005-08-12 09:26:06.000000000 -0400 @@ -108,6 +108,10 @@ static unsigned int sock_poll(struct fil static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg); static int sock_fasync(int fd, struct file *filp, int on); +static ssize_t sock_read(struct file *file, char __user *buf, + size_t len, loff_t *ppos); +static ssize_t sock_write(struct file *file, const char __user *buf, + size_t len, loff_t *ppos); static ssize_t sock_readv(struct file *file, const struct iovec *vector, unsigned long count, loff_t *ppos); static ssize_t sock_writev(struct file *file, const struct iovec *vector, @@ -124,8 +128,12 @@ static ssize_t sock_sendpage(struct file static struct file_operations socket_file_ops = { .owner = THIS_MODULE, .llseek = no_llseek, +#if 0 .aio_read = sock_aio_read, .aio_write = sock_aio_write, +#endif + .read = sock_read, + .write = sock_write, .poll = sock_poll, .unlocked_ioctl = sock_ioctl, .mmap = sock_mmap, @@ -642,7 +650,6 @@ static void sock_aio_dtor(struct kiocb * * Read data from a socket. ubuf is a user mode pointer. We make sure the user * area ubuf...ubuf+size-1 is writable before asking the protocol. */ - static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf, size_t size, loff_t pos) { @@ -776,7 +783,13 @@ static ssize_t sock_readv(struct file *f return sock_readv_writev(VERIFY_WRITE, file->f_dentry->d_inode, file, vector, count, tot_len); } - + +static ssize_t sock_read(struct file *file, char __user *buf, size_t len, loff_t *ppos) +{ + struct iovec local_iov = { .iov_base = buf, .iov_len = len }; + return sock_readv(file, &local_iov, 1, ppos); +} + static ssize_t sock_writev(struct file *file, const struct iovec *vector, unsigned long count, loff_t *ppos) { @@ -788,6 +801,13 @@ static ssize_t sock_writev(struct file * file, vector, count, tot_len); } +static ssize_t sock_write(struct file *file, const char __user *buf, size_t len, loff_t *ppos) +{ + struct iovec local_iov = { .iov_base = (void __user *)buf, + .iov_len = len }; + return sock_writev(file, &local_iov, 1, ppos); +} + /* * Atomic setting of ioctl hooks to avoid race