diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-12-14 16:01:20 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-14 03:59:35 -0700 |
commit | 84ef0ec98763c1ce92d0cc24d29d9953bb6bd3f1 (patch) | |
tree | 90f954b97ef2f86f45d894702adb79ee585a9886 /xlators/performance/io-cache | |
parent | 1e5653165a97999288cbf40e670d6c84a31ad3f6 (diff) |
performance/io-cache: cleanup the xlator private data completely in fini.
Change-Id: Ib8859c57e89248ccaad94662f88944e79ec28d5a
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/791
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/performance/io-cache')
-rw-r--r-- | xlators/performance/io-cache/src/io-cache.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 5b909091ef0..2af50f962dd 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); |