summaryrefslogtreecommitdiffstats
path: root/fs/orangefs/file.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-10-08 18:31:05 -0400
committerMike Marshall <hubcap@omnibond.com>2015-11-13 11:36:31 -0500
commit74f68fce2a395a188d454a488ea167affa4d7cf5 (patch)
tree75924016acaf0b4c5751231407b819549a53c1d6 /fs/orangefs/file.c
parent0071ed1ec663fa87a3a8ae18f6d0812db010a343 (diff)
downloadlinux-74f68fce2a395a188d454a488ea167affa4d7cf5.tar.bz2
orangefs: make pvfs2_inode_read() take iov_iter
... and make the only caller use page-backed iov_iter, getting rid of kmap/kunmap *and* of the bug with attempted use of iovec-backed copy_page_to_iter() on a kernel pointer. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/file.c')
-rw-r--r--fs/orangefs/file.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index 8dae04dc9df4..78d296bb870e 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -369,22 +369,17 @@ out:
* Data may be placed either in a user or kernel buffer.
*/
ssize_t pvfs2_inode_read(struct inode *inode,
- char __user *buf,
- size_t count,
+ struct iov_iter *iter,
loff_t *offset,
loff_t readahead_size)
{
struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
+ size_t count = iov_iter_count(iter);
size_t bufmap_size;
- struct iovec vec;
- struct iov_iter iter;
ssize_t ret = -EINVAL;
g_pvfs2_stats.reads++;
- vec.iov_base = buf;
- vec.iov_len = count;
-
bufmap_size = pvfs_bufmap_size_query();
if (count > bufmap_size) {
gossip_debug(GOSSIP_FILE_DEBUG,
@@ -400,8 +395,7 @@ ssize_t pvfs2_inode_read(struct inode *inode,
count,
llu(*offset));
- iov_iter_init(&iter, READ, &vec, 1, count);
- ret = wait_for_direct_io(PVFS_IO_READ, inode, offset, &iter,
+ ret = wait_for_direct_io(PVFS_IO_READ, inode, offset, iter,
count, readahead_size);
if (ret > 0)
*offset += ret;