Lines Matching refs:cache
11 void io_alloc_cache_free(struct io_alloc_cache *cache,
13 bool io_alloc_cache_init(struct io_alloc_cache *cache,
17 void *io_cache_alloc_new(struct io_alloc_cache *cache, gfp_t gfp);
19 static inline bool io_alloc_cache_put(struct io_alloc_cache *cache, in io_alloc_cache_put() argument
22 if (cache->nr_cached < cache->max_cached) { in io_alloc_cache_put()
25 cache->entries[cache->nr_cached++] = entry; in io_alloc_cache_put()
31 static inline void *io_alloc_cache_get(struct io_alloc_cache *cache) in io_alloc_cache_get() argument
33 if (cache->nr_cached) { in io_alloc_cache_get()
34 void *entry = cache->entries[--cache->nr_cached]; in io_alloc_cache_get()
42 kasan_mempool_unpoison_object(entry, cache->elem_size); in io_alloc_cache_get()
43 if (cache->init_clear) in io_alloc_cache_get()
44 memset(entry, 0, cache->init_clear); in io_alloc_cache_get()
52 static inline void *io_cache_alloc(struct io_alloc_cache *cache, gfp_t gfp) in io_cache_alloc() argument
56 obj = io_alloc_cache_get(cache); in io_cache_alloc()
59 return io_cache_alloc_new(cache, gfp); in io_cache_alloc()
62 static inline void io_cache_free(struct io_alloc_cache *cache, void *obj) in io_cache_free() argument
64 if (!io_alloc_cache_put(cache, obj)) in io_cache_free()