Lines Matching refs:pool

14 	struct ceph_msgpool *pool = arg;  in msgpool_alloc()  local
17 msg = ceph_msg_new2(pool->type, pool->front_len, pool->max_data_items, in msgpool_alloc()
20 dout("msgpool_alloc %s failed\n", pool->name); in msgpool_alloc()
22 dout("msgpool_alloc %s %p\n", pool->name, msg); in msgpool_alloc()
23 msg->pool = pool; in msgpool_alloc()
30 struct ceph_msgpool *pool = arg; in msgpool_free() local
33 dout("msgpool_release %s %p\n", pool->name, msg); in msgpool_free()
34 msg->pool = NULL; in msgpool_free()
38 int ceph_msgpool_init(struct ceph_msgpool *pool, int type, in ceph_msgpool_init() argument
43 pool->type = type; in ceph_msgpool_init()
44 pool->front_len = front_len; in ceph_msgpool_init()
45 pool->max_data_items = max_data_items; in ceph_msgpool_init()
46 pool->pool = mempool_create(size, msgpool_alloc, msgpool_free, pool); in ceph_msgpool_init()
47 if (!pool->pool) in ceph_msgpool_init()
49 pool->name = name; in ceph_msgpool_init()
53 void ceph_msgpool_destroy(struct ceph_msgpool *pool) in ceph_msgpool_destroy() argument
55 dout("msgpool %s destroy\n", pool->name); in ceph_msgpool_destroy()
56 mempool_destroy(pool->pool); in ceph_msgpool_destroy()
59 struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, int front_len, in ceph_msgpool_get() argument
64 if (front_len > pool->front_len || in ceph_msgpool_get()
65 max_data_items > pool->max_data_items) { in ceph_msgpool_get()
67 __func__, front_len, max_data_items, pool->name, in ceph_msgpool_get()
68 pool->front_len, pool->max_data_items); in ceph_msgpool_get()
72 return ceph_msg_new2(pool->type, front_len, max_data_items, in ceph_msgpool_get()
76 msg = mempool_alloc(pool->pool, GFP_NOFS); in ceph_msgpool_get()
77 dout("msgpool_get %s %p\n", pool->name, msg); in ceph_msgpool_get()
81 void ceph_msgpool_put(struct ceph_msgpool *pool, struct ceph_msg *msg) in ceph_msgpool_put() argument
83 dout("msgpool_put %s %p\n", pool->name, msg); in ceph_msgpool_put()
86 msg->front.iov_len = pool->front_len; in ceph_msgpool_put()
87 msg->hdr.front_len = cpu_to_le32(pool->front_len); in ceph_msgpool_put()
93 mempool_free(msg, pool->pool); in ceph_msgpool_put()