summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-06-16 14:26:23 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2022-08-08 22:37:17 -0400
commitca591967543ab1af7e6e68bd505ef7869d3f2175 (patch)
tree73f793a4b63dc7fcfe4cfff79eb7a9deb1e12695
parente3b42964f84c028f352c11269661d47f6ca4ab2e (diff)
downloadlinux-stable-ca591967543ab1af7e6e68bd505ef7869d3f2175.tar.gz
linux-stable-ca591967543ab1af7e6e68bd505ef7869d3f2175.tar.bz2
linux-stable-ca591967543ab1af7e6e68bd505ef7869d3f2175.zip
ITER_PIPE: lose iter_head argument of __pipe_get_pages()
it's only used to get to the partial buffer we can add to, and that's always the last one, i.e. pipe->head - 1. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--lib/iov_iter.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index bf600b4fe980..95c56d42505b 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1318,14 +1318,13 @@ EXPORT_SYMBOL(iov_iter_gap_alignment);
static inline ssize_t __pipe_get_pages(struct iov_iter *i,
size_t maxsize,
struct page **pages,
- int iter_head,
size_t off)
{
struct pipe_inode_info *pipe = i->pipe;
ssize_t left = maxsize;
if (off) {
- struct pipe_buffer *buf = pipe_buf(pipe, iter_head);
+ struct pipe_buffer *buf = pipe_buf(pipe, pipe->head - 1);
get_page(*pages++ = buf->page);
left -= PAGE_SIZE - off;
@@ -1363,7 +1362,7 @@ static ssize_t pipe_get_pages(struct iov_iter *i,
npages = pipe_space_for_user(iter_head, i->pipe->tail, i->pipe);
capacity = min(npages, maxpages) * PAGE_SIZE - *start;
- return __pipe_get_pages(i, min(maxsize, capacity), pages, iter_head, *start);
+ return __pipe_get_pages(i, min(maxsize, capacity), pages, *start);
}
static ssize_t iter_xarray_populate_pages(struct page **pages, struct xarray *xa,
@@ -1545,7 +1544,7 @@ static ssize_t pipe_get_pages_alloc(struct iov_iter *i,
p = get_pages_array(npages);
if (!p)
return -ENOMEM;
- n = __pipe_get_pages(i, maxsize, p, iter_head, *start);
+ n = __pipe_get_pages(i, maxsize, p, *start);
if (n > 0)
*pages = p;
else