From: Cyrill Gorcunov <gorcunov@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH next] fs/splice: iter_to_pipe -- Use PIPE_DEF_BUFFERS instead of hardcoded number
Date: Wed, 30 Jan 2019 18:39:11 +0300 [thread overview]
Message-ID: <20190130153911.GJ2332@uranus.lan> (raw)
And use ARRAY_SIZE for easier code modification if we ever need in future.
CC: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
fs/splice.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-next.git/fs/splice.c
===================================================================
--- linux-next.git.orig/fs/splice.c
+++ linux-next.git/fs/splice.c
@@ -1203,12 +1203,12 @@ static int iter_to_pipe(struct iov_iter
bool failed = false;
while (iov_iter_count(from) && !failed) {
- struct page *pages[16];
+ struct page *pages[PIPE_DEF_BUFFERS];
ssize_t copied;
size_t start;
int n;
- copied = iov_iter_get_pages(from, pages, ~0UL, 16, &start);
+ copied = iov_iter_get_pages(from, pages, ~0UL, ARRAY_SIZE(pages), &start);
if (copied <= 0) {
ret = copied;
break;
next reply other threads:[~2019-01-30 15:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 15:39 Cyrill Gorcunov [this message]
2019-01-30 15:42 ` [PATCH next] fs/splice: iter_to_pipe -- Use PIPE_DEF_BUFFERS instead of hardcoded number Al Viro
2019-01-30 15:48 ` Cyrill Gorcunov
2019-01-30 16:26 ` Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190130153911.GJ2332@uranus.lan \
--to=gorcunov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox