summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-10 20:54:51 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:32:42 -0400
commite7c24607b5d68a4cdc56e09d70a3c8bae5f0519f (patch)
tree65b8b65636ba6d2470d3a004d027ff966811d270 /mm
parentf6c0a1920e0180175bd5e8e4aff8ea5556f1895d (diff)
downloadop-kernel-dev-e7c24607b5d68a4cdc56e09d70a3c8bae5f0519f.zip
op-kernel-dev-e7c24607b5d68a4cdc56e09d70a3c8bae5f0519f.tar.gz
kill iov_iter_copy_from_user()
all callers can use copy_page_from_iter() and it actually simplifies them. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r--mm/iov_iter.c27
-rw-r--r--mm/process_vm_access.c6
2 files changed, 1 insertions, 32 deletions
diff --git a/mm/iov_iter.c b/mm/iov_iter.c
index 10e46cd..22ec1ef 100644
--- a/mm/iov_iter.c
+++ b/mm/iov_iter.c
@@ -129,33 +129,6 @@ size_t iov_iter_copy_from_user_atomic(struct page *page,
}
EXPORT_SYMBOL(iov_iter_copy_from_user_atomic);
-/*
- * This has the same sideeffects and return value as
- * iov_iter_copy_from_user_atomic().
- * The difference is that it attempts to resolve faults.
- * Page must not be locked.
- */
-size_t iov_iter_copy_from_user(struct page *page,
- struct iov_iter *i, unsigned long offset, size_t bytes)
-{
- char *kaddr;
- size_t copied;
-
- kaddr = kmap(page);
- if (likely(i->nr_segs == 1)) {
- int left;
- char __user *buf = i->iov->iov_base + i->iov_offset;
- left = __copy_from_user(kaddr + offset, buf, bytes);
- copied = bytes - left;
- } else {
- copied = __iovec_copy_from_user_inatomic(kaddr + offset,
- i->iov, i->iov_offset, bytes);
- }
- kunmap(page);
- return copied;
-}
-EXPORT_SYMBOL(iov_iter_copy_from_user);
-
void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
BUG_ON(i->count < bytes);
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c
index 8505c92..f32b1fb 100644
--- a/mm/process_vm_access.c
+++ b/mm/process_vm_access.c
@@ -46,11 +46,7 @@ static int process_vm_rw_pages(struct page **pages,
copy = len;
if (vm_write) {
- if (copy > iov_iter_count(iter))
- copy = iov_iter_count(iter);
- copied = iov_iter_copy_from_user(page, iter,
- offset, copy);
- iov_iter_advance(iter, copied);
+ copied = copy_page_from_iter(page, offset, copy, iter);
set_page_dirty_lock(page);
} else {
copied = copy_page_to_iter(page, offset, copy, iter);
OpenPOWER on IntegriCloud