From 4874b1901b8fc994bea7ea85c1a8c0dbaabd4009 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 30 Sep 2009 11:43:31 -0700 Subject: [PATCH] kclient: try kmalloc, then vmalloc "A still-lame-but-less-lame option here would be to attempt the kmalloc (with __GFP_NOWARN) and if it failed, fall back to vmalloc." says akpm --- src/TODO | 6 ++++-- src/kernel/buffer.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/TODO b/src/TODO index d7f1e8c1284be..55b53b7be4cb4 100644 --- a/src/TODO +++ b/src/TODO @@ -24,9 +24,11 @@ v0.16 /- uninline frags /- uninline string hash - document data structures -- audit all inline in kclient +/- audit all inline in kclient - document on-wire protocol -- ceph_buffer fixes +- ceph_buffer and vmalloc? +- ceph_i_test +- bit ops in messenger bugs - mislinked directory? diff --git a/src/kernel/buffer.c b/src/kernel/buffer.c index 635e7df4bd6ca..cf9aaccef22ba 100644 --- a/src/kernel/buffer.c +++ b/src/kernel/buffer.c @@ -18,8 +18,8 @@ struct ceph_buffer *ceph_buffer_new(gfp_t gfp) int ceph_buffer_alloc(struct ceph_buffer *b, int len, gfp_t gfp) { - if (len <= PAGE_SIZE) { - b->vec.iov_base = kmalloc(len, gfp); + b->vec.iov_base = kmalloc(len, gfp | __GFP_NOWARN); + if (b->vec.iov_base) { b->is_vmalloc = false; } else { b->vec.iov_base = __vmalloc(len, gfp, PAGE_KERNEL); -- 2.39.5