From 84ef0ec98763c1ce92d0cc24d29d9953bb6bd3f1 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 14 Dec 2011 16:01:20 +0530 Subject: performance/io-cache: cleanup the xlator private data completely in fini. Change-Id: Ib8859c57e89248ccaad94662f88944e79ec28d5a BUG: 767862 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.com/791 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/performance/io-cache/src/io-cache.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'xlators/performance') diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 5b909091e..2af50f962 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1923,18 +1923,33 @@ out: void fini (xlator_t *this) { - ioc_table_t *table = NULL; + ioc_table_t *table = NULL; + struct ioc_priority *curr = NULL, *tmp = NULL; + int i = 0; table = this->private; if (table == NULL) return; + this->private = NULL; + if (table->mem_pool != NULL) { mem_pool_destroy (table->mem_pool); table->mem_pool = NULL; } + list_for_each_entry_safe (curr, tmp, &table->priority_list, list) { + list_del_init (&curr->list); + GF_FREE (curr->pattern); + GF_FREE (curr); + } + + for (i = 0; i < table->max_pri; i++) { + GF_ASSERT (list_empty (&table->inode_lru[i])); + } + + GF_ASSERT (list_empty (&table->inodes)); pthread_mutex_destroy (&table->table_lock); GF_FREE (table); -- cgit