summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-02 19:56:54 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:37:58 -0400
commitfb9096a344e2964c6a71520931c08abb1301248e (patch)
tree1874e0af887636006ffec3110c90bd173e84c5f5 /fs
parente6a7bcb4c489e3e078ba3cc92ae6621b2b8bb9a7 (diff)
downloadop-kernel-dev-fb9096a344e2964c6a71520931c08abb1301248e.zip
op-kernel-dev-fb9096a344e2964c6a71520931c08abb1301248e.tar.gz
pipe: switch to ->read_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/pipe.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index cd4ccf0..05ccb00 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -271,24 +271,18 @@ static const struct pipe_buf_operations packet_pipe_buf_ops = {
};
static ssize_t
-pipe_read(struct kiocb *iocb, const struct iovec *_iov,
- unsigned long nr_segs, loff_t pos)
+pipe_read(struct kiocb *iocb, struct iov_iter *to)
{
+ size_t total_len = iov_iter_count(to);
struct file *filp = iocb->ki_filp;
struct pipe_inode_info *pipe = filp->private_data;
int do_wakeup;
ssize_t ret;
- struct iovec *iov = (struct iovec *)_iov;
- size_t total_len;
- struct iov_iter iter;
- total_len = iov_length(iov, nr_segs);
/* Null read succeeds. */
if (unlikely(total_len == 0))
return 0;
- iov_iter_init(&iter, READ, iov, nr_segs, total_len);
-
do_wakeup = 0;
ret = 0;
__pipe_lock(pipe);
@@ -312,7 +306,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
break;
}
- written = copy_page_to_iter(buf->page, buf->offset, chars, &iter);
+ written = copy_page_to_iter(buf->page, buf->offset, chars, to);
if (unlikely(written < chars)) {
if (!ret)
ret = -EFAULT;
@@ -1044,8 +1038,8 @@ err:
const struct file_operations pipefifo_fops = {
.open = fifo_open,
.llseek = no_llseek,
- .read = do_sync_read,
- .aio_read = pipe_read,
+ .read = new_sync_read,
+ .read_iter = pipe_read,
.write = do_sync_write,
.aio_write = pipe_write,
.poll = pipe_poll,
OpenPOWER on IntegriCloud