Lines Matching refs:pool

12 	struct ceph_msgpool *pool = arg;  in msgpool_alloc()  local
15 msg = ceph_msg_new(pool->type, pool->front_len, gfp_mask, true); in msgpool_alloc()
17 dout("msgpool_alloc %s failed\n", pool->name); in msgpool_alloc()
19 dout("msgpool_alloc %s %p\n", pool->name, msg); in msgpool_alloc()
20 msg->pool = pool; in msgpool_alloc()
27 struct ceph_msgpool *pool = arg; in msgpool_free() local
30 dout("msgpool_release %s %p\n", pool->name, msg); in msgpool_free()
31 msg->pool = NULL; in msgpool_free()
35 int ceph_msgpool_init(struct ceph_msgpool *pool, int type, in ceph_msgpool_init() argument
39 pool->type = type; in ceph_msgpool_init()
40 pool->front_len = front_len; in ceph_msgpool_init()
41 pool->pool = mempool_create(size, msgpool_alloc, msgpool_free, pool); in ceph_msgpool_init()
42 if (!pool->pool) in ceph_msgpool_init()
44 pool->name = name; in ceph_msgpool_init()
48 void ceph_msgpool_destroy(struct ceph_msgpool *pool) in ceph_msgpool_destroy() argument
50 dout("msgpool %s destroy\n", pool->name); in ceph_msgpool_destroy()
51 mempool_destroy(pool->pool); in ceph_msgpool_destroy()
54 struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, in ceph_msgpool_get() argument
59 if (front_len > pool->front_len) { in ceph_msgpool_get()
61 pool->name, front_len, pool->front_len); in ceph_msgpool_get()
65 return ceph_msg_new(pool->type, front_len, GFP_NOFS, false); in ceph_msgpool_get()
68 msg = mempool_alloc(pool->pool, GFP_NOFS); in ceph_msgpool_get()
69 dout("msgpool_get %s %p\n", pool->name, msg); in ceph_msgpool_get()
73 void ceph_msgpool_put(struct ceph_msgpool *pool, struct ceph_msg *msg) in ceph_msgpool_put() argument
75 dout("msgpool_put %s %p\n", pool->name, msg); in ceph_msgpool_put()
78 msg->front.iov_len = pool->front_len; in ceph_msgpool_put()
79 msg->hdr.front_len = cpu_to_le32(pool->front_len); in ceph_msgpool_put()
82 mempool_free(msg, pool->pool); in ceph_msgpool_put()