at v4.11 736 B view raw
1#ifndef _FS_CEPH_MSGPOOL 2#define _FS_CEPH_MSGPOOL 3 4#include <linux/mempool.h> 5 6/* 7 * we use memory pools for preallocating messages we may receive, to 8 * avoid unexpected OOM conditions. 9 */ 10struct ceph_msgpool { 11 const char *name; 12 mempool_t *pool; 13 int type; /* preallocated message type */ 14 int front_len; /* preallocated payload size */ 15}; 16 17extern int ceph_msgpool_init(struct ceph_msgpool *pool, int type, 18 int front_len, int size, bool blocking, 19 const char *name); 20extern void ceph_msgpool_destroy(struct ceph_msgpool *pool); 21extern struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *, 22 int front_len); 23extern void ceph_msgpool_put(struct ceph_msgpool *, struct ceph_msg *); 24 25#endif