Lines Matching refs:pool

14 	struct ceph_msgpool *pool = arg;  in msgpool_alloc()  local
17 msg = ceph_msg_new(pool->type, pool->front_len, gfp_mask, true); in msgpool_alloc()
19 dout("msgpool_alloc %s failed\n", pool->name); in msgpool_alloc()
21 dout("msgpool_alloc %s %p\n", pool->name, msg); in msgpool_alloc()
22 msg->pool = pool; in msgpool_alloc()
29 struct ceph_msgpool *pool = arg; in msgpool_free() local
32 dout("msgpool_release %s %p\n", pool->name, msg); in msgpool_free()
33 msg->pool = NULL; in msgpool_free()
37 int ceph_msgpool_init(struct ceph_msgpool *pool, int type, in ceph_msgpool_init() argument
41 pool->type = type; in ceph_msgpool_init()
42 pool->front_len = front_len; in ceph_msgpool_init()
43 pool->pool = mempool_create(size, msgpool_alloc, msgpool_free, pool); in ceph_msgpool_init()
44 if (!pool->pool) in ceph_msgpool_init()
46 pool->name = name; in ceph_msgpool_init()
50 void ceph_msgpool_destroy(struct ceph_msgpool *pool) in ceph_msgpool_destroy() argument
52 dout("msgpool %s destroy\n", pool->name); in ceph_msgpool_destroy()
53 mempool_destroy(pool->pool); in ceph_msgpool_destroy()
56 struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, in ceph_msgpool_get() argument
61 if (front_len > pool->front_len) { in ceph_msgpool_get()
63 pool->name, front_len, pool->front_len); in ceph_msgpool_get()
67 return ceph_msg_new(pool->type, front_len, GFP_NOFS, false); in ceph_msgpool_get()
70 msg = mempool_alloc(pool->pool, GFP_NOFS); in ceph_msgpool_get()
71 dout("msgpool_get %s %p\n", pool->name, msg); in ceph_msgpool_get()
75 void ceph_msgpool_put(struct ceph_msgpool *pool, struct ceph_msg *msg) in ceph_msgpool_put() argument
77 dout("msgpool_put %s %p\n", pool->name, msg); in ceph_msgpool_put()
80 msg->front.iov_len = pool->front_len; in ceph_msgpool_put()
81 msg->hdr.front_len = cpu_to_le32(pool->front_len); in ceph_msgpool_put()
84 mempool_free(msg, pool->pool); in ceph_msgpool_put()