Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
msgpool.h
Go to the documentation of this file.
1 #ifndef _FS_CEPH_MSGPOOL
2 #define _FS_CEPH_MSGPOOL
3 
4 #include <linux/mempool.h>
5 #include <linux/ceph/messenger.h>
6 
7 /*
8  * we use memory pools for preallocating messages we may receive, to
9  * avoid unexpected OOM conditions.
10  */
11 struct ceph_msgpool {
12  const char *name;
14  int type; /* preallocated message type */
15  int front_len; /* preallocated payload size */
16 };
17 
18 extern int ceph_msgpool_init(struct ceph_msgpool *pool, int type,
19  int front_len, int size, bool blocking,
20  const char *name);
21 extern void ceph_msgpool_destroy(struct ceph_msgpool *pool);
22 extern struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *,
23  int front_len);
24 extern void ceph_msgpool_put(struct ceph_msgpool *, struct ceph_msg *);
25 
26 #endif