aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-04 19:23:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:39:45 -0400
commit81055e584f9d743cb13dc7944923d817c20f089d (patch)
tree06213185809c19175258bdb12f07204c79368cea /mm
parent6abd232274fd652e4a57f486d14e52ffee6f72e9 (diff)
optimize copy_page_{to,from}_iter()
if we'd ended up in the end of a segment, jump to the beginning of the next one (iov_offset = 0, iov++), rather than having the next primitive deal with that. Ought to be folded back... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r--mm/iov_iter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/iov_iter.c b/mm/iov_iter.c
index 081e3273085b..fcdaaab438b6 100644
--- a/mm/iov_iter.c
+++ b/mm/iov_iter.c
@@ -74,6 +74,10 @@ size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
74 } 74 }
75 kunmap(page); 75 kunmap(page);
76done: 76done:
77 if (skip == iov->iov_len) {
78 iov++;
79 skip = 0;
80 }
77 i->count -= wanted - bytes; 81 i->count -= wanted - bytes;
78 i->nr_segs -= iov - i->iov; 82 i->nr_segs -= iov - i->iov;
79 i->iov = iov; 83 i->iov = iov;
@@ -152,6 +156,10 @@ size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
152 } 156 }
153 kunmap(page); 157 kunmap(page);
154done: 158done:
159 if (skip == iov->iov_len) {
160 iov++;
161 skip = 0;
162 }
155 i->count -= wanted - bytes; 163 i->count -= wanted - bytes;
156 i->nr_segs -= iov - i->iov; 164 i->nr_segs -= iov - i->iov;
157 i->iov = iov; 165 i->iov = iov;