Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _FS_CEPH_MSGPOOL
0003 #define _FS_CEPH_MSGPOOL
0004 
0005 #include <linux/mempool.h>
0006 
0007 /*
0008  * we use memory pools for preallocating messages we may receive, to
0009  * avoid unexpected OOM conditions.
0010  */
0011 struct ceph_msgpool {
0012     const char *name;
0013     mempool_t *pool;
0014     int type;               /* preallocated message type */
0015     int front_len;          /* preallocated payload size */
0016     int max_data_items;
0017 };
0018 
0019 int ceph_msgpool_init(struct ceph_msgpool *pool, int type,
0020               int front_len, int max_data_items, int size,
0021               const char *name);
0022 extern void ceph_msgpool_destroy(struct ceph_msgpool *pool);
0023 struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, int front_len,
0024                   int max_data_items);
0025 extern void ceph_msgpool_put(struct ceph_msgpool *, struct ceph_msg *);
0026 
0027 #endif