1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (C) 2021 Intel Corporation. 3 * All rights reserved. 4 */ 5 6 #ifndef OCF_MPOOL_H 7 #define OCF_MPOOL_H 8 9 enum { 10 env_mpool_1, 11 env_mpool_2, 12 env_mpool_4, 13 env_mpool_8, 14 env_mpool_16, 15 env_mpool_32, 16 env_mpool_64, 17 env_mpool_128, 18 19 env_mpool_max 20 }; 21 22 struct env_mpool; 23 24 struct env_mpool *env_mpool_create(uint32_t hdr_size, uint32_t elem_size, 25 int flags, int mpool_max, bool fallback, 26 const uint32_t limits[env_mpool_max], 27 const char *name_perfix, bool zero); 28 29 void env_mpool_destroy(struct env_mpool *mpools); 30 31 void *env_mpool_new(struct env_mpool *mpool, uint32_t count); 32 33 bool env_mpool_del(struct env_mpool *mpool, 34 void *items, uint32_t count); 35 36 #endif 37