Lines Matching refs:alloc_size
84 static bool __check_shared_memory(size_t alloc_size) in __check_shared_memory() argument
88 a = shared_memory_amount + alloc_size; in __check_shared_memory()
100 static bool check_shared_memory(size_t alloc_size) in check_shared_memory() argument
106 ret = __check_shared_memory(alloc_size); in check_shared_memory()
113 static bool claim_shared_memory(size_t alloc_size) in claim_shared_memory() argument
117 if (!__check_shared_memory(alloc_size)) { in claim_shared_memory()
122 shared_memory_amount += alloc_size; in claim_shared_memory()
129 static void free_shared_memory(size_t alloc_size) in free_shared_memory() argument
135 if (WARN_ON_ONCE(shared_memory_amount < alloc_size)) { in free_shared_memory()
141 shared_memory_amount -= alloc_size; in free_shared_memory()
146 static void *dm_kvzalloc(size_t alloc_size, int node) in dm_kvzalloc() argument
150 if (!claim_shared_memory(alloc_size)) in dm_kvzalloc()
153 p = kvzalloc_node(alloc_size, GFP_KERNEL | __GFP_NOMEMALLOC, node); in dm_kvzalloc()
157 free_shared_memory(alloc_size); in dm_kvzalloc()
162 static void dm_kvfree(void *ptr, size_t alloc_size) in dm_kvfree() argument
167 free_shared_memory(alloc_size); in dm_kvfree()