[PATCH 15/18] orangefs: call generic_file_read_iter

From: Martin Brandenburg
Date: Tue Dec 12 2017 - 13:36:36 EST


From: Martin Brandenburg <martin@xxxxxxxxxxxx>

No need to manually implement this. The generic implementation handles
direct IO as well.

Signed-off-by: Martin Brandenburg <martin@xxxxxxxxxxxx>
---
fs/orangefs/file.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index 0223a0351d11..d80e1e6c1d95 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -390,22 +390,11 @@ static ssize_t orangefs_inode_read(struct inode *inode,
return ret;
}

-static ssize_t orangefs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
+static ssize_t orangefs_file_read_iter(struct kiocb *iocb,
+ struct iov_iter *iter)
{
- struct file *file = iocb->ki_filp;
- loff_t pos = *(&iocb->ki_pos);
- ssize_t rc = 0;
-
- BUG_ON(iocb->private);
-
- gossip_debug(GOSSIP_FILE_DEBUG, "orangefs_file_read_iter\n");
-
orangefs_stats.reads++;
-
- rc = do_readv_writev(ORANGEFS_IO_READ, file, &pos, iter);
- iocb->ki_pos = pos;
-
- return rc;
+ return generic_file_read_iter(iocb, iter);
}

static ssize_t orangefs_file_write_iter(struct kiocb *iocb, struct iov_iter *iter)
--
2.15.1