diff options
Diffstat (limited to 'net/ceph/msgpool.c')
| -rw-r--r-- | net/ceph/msgpool.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ceph/msgpool.c b/net/ceph/msgpool.c index 11d5f4196a73..ddec1c10ac80 100644 --- a/net/ceph/msgpool.c +++ b/net/ceph/msgpool.c | |||
| @@ -12,7 +12,7 @@ static void *msgpool_alloc(gfp_t gfp_mask, void *arg) | |||
| 12 | struct ceph_msgpool *pool = arg; | 12 | struct ceph_msgpool *pool = arg; |
| 13 | struct ceph_msg *msg; | 13 | struct ceph_msg *msg; |
| 14 | 14 | ||
| 15 | msg = ceph_msg_new(0, pool->front_len, gfp_mask, true); | 15 | msg = ceph_msg_new(pool->type, pool->front_len, gfp_mask, true); |
| 16 | if (!msg) { | 16 | if (!msg) { |
| 17 | dout("msgpool_alloc %s failed\n", pool->name); | 17 | dout("msgpool_alloc %s failed\n", pool->name); |
| 18 | } else { | 18 | } else { |
| @@ -32,10 +32,11 @@ static void msgpool_free(void *element, void *arg) | |||
| 32 | ceph_msg_put(msg); | 32 | ceph_msg_put(msg); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | int ceph_msgpool_init(struct ceph_msgpool *pool, | 35 | int ceph_msgpool_init(struct ceph_msgpool *pool, int type, |
| 36 | int front_len, int size, bool blocking, const char *name) | 36 | int front_len, int size, bool blocking, const char *name) |
| 37 | { | 37 | { |
| 38 | dout("msgpool %s init\n", name); | 38 | dout("msgpool %s init\n", name); |
| 39 | pool->type = type; | ||
| 39 | pool->front_len = front_len; | 40 | pool->front_len = front_len; |
| 40 | pool->pool = mempool_create(size, msgpool_alloc, msgpool_free, pool); | 41 | pool->pool = mempool_create(size, msgpool_alloc, msgpool_free, pool); |
| 41 | if (!pool->pool) | 42 | if (!pool->pool) |
| @@ -61,7 +62,7 @@ struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, | |||
| 61 | WARN_ON(1); | 62 | WARN_ON(1); |
| 62 | 63 | ||
| 63 | /* try to alloc a fresh message */ | 64 | /* try to alloc a fresh message */ |
| 64 | return ceph_msg_new(0, front_len, GFP_NOFS, false); | 65 | return ceph_msg_new(pool->type, front_len, GFP_NOFS, false); |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | msg = mempool_alloc(pool->pool, GFP_NOFS); | 68 | msg = mempool_alloc(pool->pool, GFP_NOFS); |
