Commit 903bb32e authored by Alex Elder's avatar Alex Elder

libceph: drop return value from page vector copy routines

The return values provided for ceph_copy_to_page_vector() and
ceph_copy_from_page_vector() serve no purpose, so get rid of them.
Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 23ed6e13
...@@ -1890,8 +1890,7 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev, ...@@ -1890,8 +1890,7 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev,
if (ret < 0) if (ret < 0)
goto out; goto out;
ret = 0; ret = 0;
(void) ceph_copy_from_page_vector(pages, inbound, 0, ceph_copy_from_page_vector(pages, inbound, 0, obj_request->xferred);
obj_request->xferred);
if (version) if (version)
*version = obj_request->version; *version = obj_request->version;
out: out:
...@@ -2089,7 +2088,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, ...@@ -2089,7 +2088,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
rbd_assert(obj_request->xferred <= (u64) SIZE_MAX); rbd_assert(obj_request->xferred <= (u64) SIZE_MAX);
size = (size_t) obj_request->xferred; size = (size_t) obj_request->xferred;
(void) ceph_copy_from_page_vector(pages, buf, 0, size); ceph_copy_from_page_vector(pages, buf, 0, size);
rbd_assert(size <= (size_t) INT_MAX); rbd_assert(size <= (size_t) INT_MAX);
ret = (int) size; ret = (int) size;
if (version) if (version)
......
...@@ -232,10 +232,10 @@ extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); ...@@ -232,10 +232,10 @@ extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags);
extern int ceph_copy_user_to_page_vector(struct page **pages, extern int ceph_copy_user_to_page_vector(struct page **pages,
const void __user *data, const void __user *data,
loff_t off, size_t len); loff_t off, size_t len);
extern int ceph_copy_to_page_vector(struct page **pages, extern void ceph_copy_to_page_vector(struct page **pages,
const void *data, const void *data,
loff_t off, size_t len); loff_t off, size_t len);
extern int ceph_copy_from_page_vector(struct page **pages, extern void ceph_copy_from_page_vector(struct page **pages,
void *data, void *data,
loff_t off, size_t len); loff_t off, size_t len);
extern int ceph_copy_page_vector_to_user(struct page **pages, void __user *data, extern int ceph_copy_page_vector_to_user(struct page **pages, void __user *data,
......
...@@ -118,17 +118,17 @@ int ceph_copy_user_to_page_vector(struct page **pages, ...@@ -118,17 +118,17 @@ int ceph_copy_user_to_page_vector(struct page **pages,
} }
EXPORT_SYMBOL(ceph_copy_user_to_page_vector); EXPORT_SYMBOL(ceph_copy_user_to_page_vector);
int ceph_copy_to_page_vector(struct page **pages, void ceph_copy_to_page_vector(struct page **pages,
const void *data, const void *data,
loff_t off, size_t len) loff_t off, size_t len)
{ {
int i = 0; int i = 0;
size_t po = off & ~PAGE_CACHE_MASK; size_t po = off & ~PAGE_CACHE_MASK;
size_t left = len; size_t left = len;
size_t l;
while (left > 0) { while (left > 0) {
l = min_t(size_t, PAGE_CACHE_SIZE-po, left); size_t l = min_t(size_t, PAGE_CACHE_SIZE-po, left);
memcpy(page_address(pages[i]) + po, data, l); memcpy(page_address(pages[i]) + po, data, l);
data += l; data += l;
left -= l; left -= l;
...@@ -138,21 +138,20 @@ int ceph_copy_to_page_vector(struct page **pages, ...@@ -138,21 +138,20 @@ int ceph_copy_to_page_vector(struct page **pages,
i++; i++;
} }
} }
return len;
} }
EXPORT_SYMBOL(ceph_copy_to_page_vector); EXPORT_SYMBOL(ceph_copy_to_page_vector);
int ceph_copy_from_page_vector(struct page **pages, void ceph_copy_from_page_vector(struct page **pages,
void *data, void *data,
loff_t off, size_t len) loff_t off, size_t len)
{ {
int i = 0; int i = 0;
size_t po = off & ~PAGE_CACHE_MASK; size_t po = off & ~PAGE_CACHE_MASK;
size_t left = len; size_t left = len;
size_t l;
while (left > 0) { while (left > 0) {
l = min_t(size_t, PAGE_CACHE_SIZE-po, left); size_t l = min_t(size_t, PAGE_CACHE_SIZE-po, left);
memcpy(data, page_address(pages[i]) + po, l); memcpy(data, page_address(pages[i]) + po, l);
data += l; data += l;
left -= l; left -= l;
...@@ -162,7 +161,6 @@ int ceph_copy_from_page_vector(struct page **pages, ...@@ -162,7 +161,6 @@ int ceph_copy_from_page_vector(struct page **pages,
i++; i++;
} }
} }
return len;
} }
EXPORT_SYMBOL(ceph_copy_from_page_vector); EXPORT_SYMBOL(ceph_copy_from_page_vector);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment