diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-04 04:31:22 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 23:39:42 +0200 |
commit | 2b777c9dd9ebbb2f8b6818d454cc5e6d7c1e3c8b (patch) | |
tree | aceac852de465a0205a7073496126925620ea7cf /net/ceph/pagevec.c | |
parent | new helper: copy_page_from_iter() (diff) | |
download | linux-2b777c9dd9ebbb2f8b6818d454cc5e6d7c1e3c8b.tar.xz linux-2b777c9dd9ebbb2f8b6818d454cc5e6d7c1e3c8b.zip |
ceph_sync_read: stop poking into iov_iter guts
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/ceph/pagevec.c')
-rw-r--r-- | net/ceph/pagevec.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/net/ceph/pagevec.c b/net/ceph/pagevec.c index 815a2249cfa9..555013034f7a 100644 --- a/net/ceph/pagevec.c +++ b/net/ceph/pagevec.c @@ -53,7 +53,10 @@ void ceph_put_page_vector(struct page **pages, int num_pages, bool dirty) set_page_dirty_lock(pages[i]); put_page(pages[i]); } - kfree(pages); + if (is_vmalloc_addr(pages)) + vfree(pages); + else + kfree(pages); } EXPORT_SYMBOL(ceph_put_page_vector); @@ -165,36 +168,6 @@ void ceph_copy_from_page_vector(struct page **pages, EXPORT_SYMBOL(ceph_copy_from_page_vector); /* - * copy user data from a page vector into a user pointer - */ -int ceph_copy_page_vector_to_user(struct page **pages, - void __user *data, - loff_t off, size_t len) -{ - int i = 0; - int po = off & ~PAGE_CACHE_MASK; - int left = len; - int l, bad; - - while (left > 0) { - l = min_t(int, left, PAGE_CACHE_SIZE-po); - bad = copy_to_user(data, page_address(pages[i]) + po, l); - if (bad == l) - return -EFAULT; - data += l - bad; - left -= l - bad; - if (po) { - po += l - bad; - if (po == PAGE_CACHE_SIZE) - po = 0; - } - i++; - } - return len; -} -EXPORT_SYMBOL(ceph_copy_page_vector_to_user); - -/* * Zero an extent within a page vector. Offset is relative to the * start of the first page. */ |