libceph: use void pointers in page vector functions
authorAlex Elder <elder@inktank.com>
Wed, 6 Feb 2013 19:11:38 +0000 (13:11 -0600)
committerAlex Elder <elder@inktank.com>
Wed, 20 Feb 2013 01:14:04 +0000 (19:14 -0600)
The functions used for working with ceph page vectors are defined
with char pointers, but they're really intended to operate on
untyped data.  Change the types of these function parameters
to (void *) to reflect this.

(Note that the functions now assume void pointer arithmetic works
like arithmetic on char pointers.)

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
include/linux/ceph/libceph.h
net/ceph/pagevec.c

index c44275ab375c82741a1d3f639465eff72b62b0a9..2250f8bb249094e95015c1f980966a5717bfff85 100644 (file)
@@ -222,7 +222,7 @@ extern int ceph_open_session(struct ceph_client *client);
 /* pagevec.c */
 extern void ceph_release_page_vector(struct page **pages, int num_pages);
 
-extern struct page **ceph_get_direct_page_vector(const char __user *data,
+extern struct page **ceph_get_direct_page_vector(const void __user *data,
                                                 int num_pages,
                                                 bool write_page);
 extern void ceph_put_page_vector(struct page **pages, int num_pages,
@@ -230,15 +230,15 @@ extern void ceph_put_page_vector(struct page **pages, int num_pages,
 extern void ceph_release_page_vector(struct page **pages, int num_pages);
 extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags);
 extern int ceph_copy_user_to_page_vector(struct page **pages,
-                                        const char __user *data,
+                                        const void __user *data,
                                         loff_t off, size_t len);
 extern int ceph_copy_to_page_vector(struct page **pages,
-                                   const char *data,
+                                   const void *data,
                                    loff_t off, size_t len);
 extern int ceph_copy_from_page_vector(struct page **pages,
-                                   char *data,
+                                   void *data,
                                    loff_t off, size_t len);
-extern int ceph_copy_page_vector_to_user(struct page **pages, char __user *data,
+extern int ceph_copy_page_vector_to_user(struct page **pages, void __user *data,
                                    loff_t off, size_t len);
 extern void ceph_zero_page_vector_range(int off, int len, struct page **pages);
 
index cd9c21df87d172fa0c7bfe1af7ee289ab5dd0494..5b20be979c1981821b39ce1d5c2341bcc375db85 100644 (file)
@@ -12,7 +12,7 @@
 /*
  * build a vector of user pages
  */
-struct page **ceph_get_direct_page_vector(const char __user *data,
+struct page **ceph_get_direct_page_vector(const void __user *data,
                                          int num_pages, bool write_page)
 {
        struct page **pages;
@@ -93,7 +93,7 @@ EXPORT_SYMBOL(ceph_alloc_page_vector);
  * copy user data into a page vector
  */
 int ceph_copy_user_to_page_vector(struct page **pages,
-                                        const char __user *data,
+                                        const void __user *data,
                                         loff_t off, size_t len)
 {
        int i = 0;
@@ -119,7 +119,7 @@ int ceph_copy_user_to_page_vector(struct page **pages,
 EXPORT_SYMBOL(ceph_copy_user_to_page_vector);
 
 int ceph_copy_to_page_vector(struct page **pages,
-                                   const char *data,
+                                   const void *data,
                                    loff_t off, size_t len)
 {
        int i = 0;
@@ -143,7 +143,7 @@ int ceph_copy_to_page_vector(struct page **pages,
 EXPORT_SYMBOL(ceph_copy_to_page_vector);
 
 int ceph_copy_from_page_vector(struct page **pages,
-                                   char *data,
+                                   void *data,
                                    loff_t off, size_t len)
 {
        int i = 0;
@@ -170,7 +170,7 @@ 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,
-                                        char __user *data,
+                                        void __user *data,
                                         loff_t off, size_t len)
 {
        int i = 0;