提交 3cd9ad5a 编写于 作者: A Al Viro

ocfs2: switch to ->read_iter()

tracepoints are evil, exhibit #6969...
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 02797829
...@@ -2529,7 +2529,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in, ...@@ -2529,7 +2529,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
in->f_path.dentry->d_name.name, len); in->f_path.dentry->d_name.name, len);
/* /*
* See the comment in ocfs2_file_aio_read() * See the comment in ocfs2_file_read_iter()
*/ */
ret = ocfs2_inode_lock_atime(inode, in->f_path.mnt, &lock_level); ret = ocfs2_inode_lock_atime(inode, in->f_path.mnt, &lock_level);
if (ret < 0) { if (ret < 0) {
...@@ -2544,10 +2544,8 @@ static ssize_t ocfs2_file_splice_read(struct file *in, ...@@ -2544,10 +2544,8 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
return ret; return ret;
} }
static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, static ssize_t ocfs2_file_read_iter(struct kiocb *iocb,
const struct iovec *iov, struct iov_iter *to)
unsigned long nr_segs,
loff_t pos)
{ {
int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0; int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0;
struct file *filp = iocb->ki_filp; struct file *filp = iocb->ki_filp;
...@@ -2556,7 +2554,8 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, ...@@ -2556,7 +2554,8 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry, trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry,
(unsigned long long)OCFS2_I(inode)->ip_blkno, (unsigned long long)OCFS2_I(inode)->ip_blkno,
filp->f_path.dentry->d_name.len, filp->f_path.dentry->d_name.len,
filp->f_path.dentry->d_name.name, nr_segs); filp->f_path.dentry->d_name.name,
to->nr_segs); /* GRRRRR */
if (!inode) { if (!inode) {
...@@ -2601,7 +2600,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, ...@@ -2601,7 +2600,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
} }
ocfs2_inode_unlock(inode, lock_level); ocfs2_inode_unlock(inode, lock_level);
ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos); ret = generic_file_read_iter(iocb, to);
trace_generic_file_aio_read_ret(ret); trace_generic_file_aio_read_ret(ret);
/* buffered aio wouldn't have proper lock coverage today */ /* buffered aio wouldn't have proper lock coverage today */
...@@ -2700,13 +2699,13 @@ const struct inode_operations ocfs2_special_file_iops = { ...@@ -2700,13 +2699,13 @@ const struct inode_operations ocfs2_special_file_iops = {
*/ */
const struct file_operations ocfs2_fops = { const struct file_operations ocfs2_fops = {
.llseek = ocfs2_file_llseek, .llseek = ocfs2_file_llseek,
.read = do_sync_read, .read = new_sync_read,
.write = do_sync_write, .write = do_sync_write,
.mmap = ocfs2_mmap, .mmap = ocfs2_mmap,
.fsync = ocfs2_sync_file, .fsync = ocfs2_sync_file,
.release = ocfs2_file_release, .release = ocfs2_file_release,
.open = ocfs2_file_open, .open = ocfs2_file_open,
.aio_read = ocfs2_file_aio_read, .read_iter = ocfs2_file_read_iter,
.aio_write = ocfs2_file_aio_write, .aio_write = ocfs2_file_aio_write,
.unlocked_ioctl = ocfs2_ioctl, .unlocked_ioctl = ocfs2_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
...@@ -2748,13 +2747,13 @@ const struct file_operations ocfs2_dops = { ...@@ -2748,13 +2747,13 @@ const struct file_operations ocfs2_dops = {
*/ */
const struct file_operations ocfs2_fops_no_plocks = { const struct file_operations ocfs2_fops_no_plocks = {
.llseek = ocfs2_file_llseek, .llseek = ocfs2_file_llseek,
.read = do_sync_read, .read = new_sync_read,
.write = do_sync_write, .write = do_sync_write,
.mmap = ocfs2_mmap, .mmap = ocfs2_mmap,
.fsync = ocfs2_sync_file, .fsync = ocfs2_sync_file,
.release = ocfs2_file_release, .release = ocfs2_file_release,
.open = ocfs2_file_open, .open = ocfs2_file_open,
.aio_read = ocfs2_file_aio_read, .read_iter = ocfs2_file_read_iter,
.aio_write = ocfs2_file_aio_write, .aio_write = ocfs2_file_aio_write,
.unlocked_ioctl = ocfs2_ioctl, .unlocked_ioctl = ocfs2_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册