Lines Matching refs:alloc_size
81 static bool __check_shared_memory(size_t alloc_size) in __check_shared_memory() argument
85 a = shared_memory_amount + alloc_size; in __check_shared_memory()
97 static bool check_shared_memory(size_t alloc_size) in check_shared_memory() argument
103 ret = __check_shared_memory(alloc_size); in check_shared_memory()
110 static bool claim_shared_memory(size_t alloc_size) in claim_shared_memory() argument
114 if (!__check_shared_memory(alloc_size)) { in claim_shared_memory()
119 shared_memory_amount += alloc_size; in claim_shared_memory()
126 static void free_shared_memory(size_t alloc_size) in free_shared_memory() argument
132 if (WARN_ON_ONCE(shared_memory_amount < alloc_size)) { in free_shared_memory()
138 shared_memory_amount -= alloc_size; in free_shared_memory()
143 static void *dm_kvzalloc(size_t alloc_size, int node) in dm_kvzalloc() argument
147 if (!claim_shared_memory(alloc_size)) in dm_kvzalloc()
150 p = kvzalloc_node(alloc_size, GFP_KERNEL | __GFP_NOMEMALLOC, node); in dm_kvzalloc()
154 free_shared_memory(alloc_size); in dm_kvzalloc()
159 static void dm_kvfree(void *ptr, size_t alloc_size) in dm_kvfree() argument
164 free_shared_memory(alloc_size); in dm_kvfree()