From: Al Viro Date: Sat, 4 Apr 2015 02:10:20 +0000 (-0400) Subject: kill do_sync_read/do_sync_write X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a219bc70b54523c8f14a3c957179854785ee97c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git kill do_sync_read/do_sync_write all remaining instances of aio_{read,write} (all 4 of them) have explicit ->read and ->write resp.; do_sync_read/do_sync_write is never called by __vfs_read/__vfs_write anymore and no other users had been left. Signed-off-by: Al Viro --- diff --git a/fs/read_write.c b/fs/read_write.c index 3ae8eee3b82a..3d42d8ee5940 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -410,23 +410,6 @@ int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t return count > MAX_RW_COUNT ? MAX_RW_COUNT : count; } -ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos) -{ - struct iovec iov = { .iov_base = buf, .iov_len = len }; - struct kiocb kiocb; - ssize_t ret; - - init_sync_kiocb(&kiocb, filp); - kiocb.ki_pos = *ppos; - - ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos); - BUG_ON(ret == -EIOCBQUEUED); - *ppos = kiocb.ki_pos; - return ret; -} - -EXPORT_SYMBOL(do_sync_read); - static ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos) { struct iovec iov = { .iov_base = buf, .iov_len = len }; @@ -449,8 +432,6 @@ ssize_t __vfs_read(struct file *file, char __user *buf, size_t count, { if (file->f_op->read) return file->f_op->read(file, buf, count, pos); - else if (file->f_op->aio_read) - return do_sync_read(file, buf, count, pos); else if (file->f_op->read_iter) return new_sync_read(file, buf, count, pos); else @@ -485,23 +466,6 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) EXPORT_SYMBOL(vfs_read); -ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos) -{ - struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len }; - struct kiocb kiocb; - ssize_t ret; - - init_sync_kiocb(&kiocb, filp); - kiocb.ki_pos = *ppos; - - ret = filp->f_op->aio_write(&kiocb, &iov, 1, kiocb.ki_pos); - BUG_ON(ret == -EIOCBQUEUED); - *ppos = kiocb.ki_pos; - return ret; -} - -EXPORT_SYMBOL(do_sync_write); - static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos) { struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len }; @@ -524,8 +488,6 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count, { if (file->f_op->write) return file->f_op->write(file, p, count, pos); - else if (file->f_op->aio_write) - return do_sync_write(file, p, count, pos); else if (file->f_op->write_iter) return new_sync_write(file, p, count, pos); else diff --git a/include/linux/fs.h b/include/linux/fs.h index cade1304d27b..83e122c1a902 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2574,8 +2574,6 @@ extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *); extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *); extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t); extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t); -extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); -extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos); ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos);