aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ceph/buffer.h3
-rw-r--r--include/linux/ceph/libceph.h1
-rw-r--r--net/ceph/buffer.c4
-rw-r--r--net/ceph/ceph_common.c8
-rw-r--r--net/ceph/messenger.c2
5 files changed, 4 insertions, 14 deletions
diff --git a/include/linux/ceph/buffer.h b/include/linux/ceph/buffer.h
index 07ad423cc37f..07ca15e76100 100644
--- a/include/linux/ceph/buffer.h
+++ b/include/linux/ceph/buffer.h
@@ -10,8 +10,7 @@
10/* 10/*
11 * a simple reference counted buffer. 11 * a simple reference counted buffer.
12 * 12 *
13 * use kmalloc for small sizes (<= one page), vmalloc for larger 13 * use kmalloc for smaller sizes, vmalloc for larger sizes.
14 * sizes.
15 */ 14 */
16struct ceph_buffer { 15struct ceph_buffer {
17 struct kref kref; 16 struct kref kref;
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 07bc359b88ac..d293f7e38814 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -184,7 +184,6 @@ extern bool libceph_compatible(void *data);
184extern const char *ceph_msg_type_name(int type); 184extern const char *ceph_msg_type_name(int type);
185extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); 185extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
186extern void *ceph_kvmalloc(size_t size, gfp_t flags); 186extern void *ceph_kvmalloc(size_t size, gfp_t flags);
187extern void ceph_kvfree(const void *ptr);
188 187
189extern struct ceph_options *ceph_parse_options(char *options, 188extern struct ceph_options *ceph_parse_options(char *options,
190 const char *dev_name, const char *dev_name_end, 189 const char *dev_name, const char *dev_name_end,
diff --git a/net/ceph/buffer.c b/net/ceph/buffer.c
index 621b5f65407f..add5f921a0ff 100644
--- a/net/ceph/buffer.c
+++ b/net/ceph/buffer.c
@@ -6,7 +6,7 @@
6 6
7#include <linux/ceph/buffer.h> 7#include <linux/ceph/buffer.h>
8#include <linux/ceph/decode.h> 8#include <linux/ceph/decode.h>
9#include <linux/ceph/libceph.h> /* for ceph_kv{malloc,free} */ 9#include <linux/ceph/libceph.h> /* for ceph_kvmalloc */
10 10
11struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp) 11struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp)
12{ 12{
@@ -35,7 +35,7 @@ void ceph_buffer_release(struct kref *kref)
35 struct ceph_buffer *b = container_of(kref, struct ceph_buffer, kref); 35 struct ceph_buffer *b = container_of(kref, struct ceph_buffer, kref);
36 36
37 dout("buffer_release %p\n", b); 37 dout("buffer_release %p\n", b);
38 ceph_kvfree(b->vec.iov_base); 38 kvfree(b->vec.iov_base);
39 kfree(b); 39 kfree(b);
40} 40}
41EXPORT_SYMBOL(ceph_buffer_release); 41EXPORT_SYMBOL(ceph_buffer_release);
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 58fbfe134f93..d361a274aee7 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -184,14 +184,6 @@ void *ceph_kvmalloc(size_t size, gfp_t flags)
184 return __vmalloc(size, flags | __GFP_HIGHMEM, PAGE_KERNEL); 184 return __vmalloc(size, flags | __GFP_HIGHMEM, PAGE_KERNEL);
185} 185}
186 186
187void ceph_kvfree(const void *ptr)
188{
189 if (is_vmalloc_addr(ptr))
190 vfree(ptr);
191 else
192 kfree(ptr);
193}
194
195 187
196static int parse_fsid(const char *str, struct ceph_fsid *fsid) 188static int parse_fsid(const char *str, struct ceph_fsid *fsid)
197{ 189{
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 8d1653caffdb..863d07ab2129 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -3288,7 +3288,7 @@ static int ceph_con_in_msg_alloc(struct ceph_connection *con, int *skip)
3288static void ceph_msg_free(struct ceph_msg *m) 3288static void ceph_msg_free(struct ceph_msg *m)
3289{ 3289{
3290 dout("%s %p\n", __func__, m); 3290 dout("%s %p\n", __func__, m);
3291 ceph_kvfree(m->front.iov_base); 3291 kvfree(m->front.iov_base);
3292 kmem_cache_free(ceph_msg_cache, m); 3292 kmem_cache_free(ceph_msg_cache, m);
3293} 3293}
3294 3294