]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
libceph: nuke ceph_kvfree()
authorIlya Dryomov <idryomov@redhat.com>
Thu, 23 Oct 2014 12:32:57 +0000 (16:32 +0400)
committerIlya Dryomov <idryomov@redhat.com>
Wed, 17 Dec 2014 17:09:50 +0000 (20:09 +0300)
Use kvfree() from linux/mm.h instead, which is identical.  Also fix the
ceph_buffer comment: we will allocate with kmalloc() up to 32k - the
value of PAGE_ALLOC_COSTLY_ORDER, but that really is just an
implementation detail so don't mention it at all.

Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
include/linux/ceph/buffer.h
include/linux/ceph/libceph.h
net/ceph/buffer.c
net/ceph/ceph_common.c
net/ceph/messenger.c

index 07ad423cc37fbe4e61febe918d5aed38fdcdf2b7..07ca15e7610016439fb4707a6e2a75418f456e87 100644 (file)
@@ -10,8 +10,7 @@
 /*
  * a simple reference counted buffer.
  *
- * use kmalloc for small sizes (<= one page), vmalloc for larger
- * sizes.
+ * use kmalloc for smaller sizes, vmalloc for larger sizes.
  */
 struct ceph_buffer {
        struct kref kref;
index 07bc359b88acc342bed7251accda960dc4d5311b..d293f7e388142b125923da81b3213872d59c909d 100644 (file)
@@ -184,7 +184,6 @@ extern bool libceph_compatible(void *data);
 extern const char *ceph_msg_type_name(int type);
 extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
 extern void *ceph_kvmalloc(size_t size, gfp_t flags);
-extern void ceph_kvfree(const void *ptr);
 
 extern struct ceph_options *ceph_parse_options(char *options,
                              const char *dev_name, const char *dev_name_end,
index 621b5f65407f739e7fb5f2f743b1421add43ddda..add5f921a0ffbef5149852177412aa02bee95e7b 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <linux/ceph/buffer.h>
 #include <linux/ceph/decode.h>
-#include <linux/ceph/libceph.h> /* for ceph_kv{malloc,free} */
+#include <linux/ceph/libceph.h> /* for ceph_kvmalloc */
 
 struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp)
 {
@@ -35,7 +35,7 @@ void ceph_buffer_release(struct kref *kref)
        struct ceph_buffer *b = container_of(kref, struct ceph_buffer, kref);
 
        dout("buffer_release %p\n", b);
-       ceph_kvfree(b->vec.iov_base);
+       kvfree(b->vec.iov_base);
        kfree(b);
 }
 EXPORT_SYMBOL(ceph_buffer_release);
index 58fbfe134f9329cde02d738e0faafd3010ac8d68..d361a274aee74df8fb1dbcaa1e63cb126ac67ccf 100644 (file)
@@ -184,14 +184,6 @@ void *ceph_kvmalloc(size_t size, gfp_t flags)
        return __vmalloc(size, flags | __GFP_HIGHMEM, PAGE_KERNEL);
 }
 
-void ceph_kvfree(const void *ptr)
-{
-       if (is_vmalloc_addr(ptr))
-               vfree(ptr);
-       else
-               kfree(ptr);
-}
-
 
 static int parse_fsid(const char *str, struct ceph_fsid *fsid)
 {
index 8d1653caffdb4104d893c2bcbac939ed465a8bc9..863d07ab212943b1821956075aaf604a735d9726 100644 (file)
@@ -3288,7 +3288,7 @@ static int ceph_con_in_msg_alloc(struct ceph_connection *con, int *skip)
 static void ceph_msg_free(struct ceph_msg *m)
 {
        dout("%s %p\n", __func__, m);
-       ceph_kvfree(m->front.iov_base);
+       kvfree(m->front.iov_base);
        kmem_cache_free(ceph_msg_cache, m);
 }