diff options
-rw-r--r-- | libglusterfs/src/mem-pool.c | 14 | ||||
-rw-r--r-- | libglusterfs/src/mem-pool.h | 2 | ||||
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 56a4a1dc29f..90df2f39e0e 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -197,3 +197,17 @@ mem_put (struct mem_pool *pool, void *ptr) } UNLOCK (&pool->lock); } + + +void +mem_pool_destroy (struct mem_pool *pool) +{ + if (!pool) + return; + + LOCK_DESTROY (&pool->lock); + FREE (pool->pool); + FREE (pool); + + return; +} diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h index 627945e1fe6..152c17bb412 100644 --- a/libglusterfs/src/mem-pool.h +++ b/libglusterfs/src/mem-pool.h @@ -52,4 +52,6 @@ mem_pool_new_fn (unsigned long sizeof_type, unsigned long count); void mem_put (struct mem_pool *pool, void *ptr); void *mem_get (struct mem_pool *pool); +void mem_pool_destroy (struct mem_pool *pool); + #endif /* _MEM_POOL_H */ diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 3136c9c1aa1..f16833609bf 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -2563,6 +2563,7 @@ deallocate_workers (iot_worker_t **workers, end_count = count + start_alloc_idx; for (i = start_alloc_idx; (i < end_count); i++) { if (workers[i] != NULL) { + mem_pool_destroy (workers[i]->req_pool); FREE (workers[i]); workers[i] = NULL; } |