2 #include "ceph_debug.h"
5 struct ceph_buffer *ceph_buffer_new(gfp_t gfp)
9 b = kmalloc(sizeof(*b), gfp);
12 atomic_set(&b->nref, 1);
13 b->vec.iov_base = NULL;
19 int ceph_buffer_alloc(struct ceph_buffer *b, int len, gfp_t gfp)
21 b->vec.iov_base = kmalloc(len, gfp | __GFP_NOWARN);
22 if (b->vec.iov_base) {
23 b->is_vmalloc = false;
25 b->vec.iov_base = __vmalloc(len, gfp, PAGE_KERNEL);