diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-12-14 15:47:01 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-14 03:49:16 -0700 |
commit | 7161d0995c937c1712d29a04356a11ca51e9ce07 (patch) | |
tree | bbfc710197d0f834af0bff6c670f477499a57861 | |
parent | 29a3dc028d2847bd8421b23b7c7ee5419bd30392 (diff) |
performance/quick-read: implement fini
Change-Id: I92d4e7ded470b0e97b699656a890bab8c113bf4f
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/790
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 1d682b62dce..56f665f675b 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -3575,8 +3575,59 @@ out: void +qr_inode_table_destroy (qr_private_t *priv) +{ + int i = 0; + qr_conf_t *conf = NULL; + + conf = &priv->conf; + + for (i = 0; i < conf->max_pri; i++) { + GF_ASSERT (list_empty (&priv->table.lru[i])); + } + + LOCK_DESTROY (&priv->table.lock); + + return; +} + + +void +qr_conf_destroy (qr_conf_t *conf) +{ + struct qr_priority *curr = NULL, *tmp = NULL; + + list_for_each_entry_safe (curr, tmp, &conf->priority_list, list) { + list_del (&curr->list); + GF_FREE (curr->pattern); + GF_FREE (curr); + } + + return; +} + + +void fini (xlator_t *this) { + qr_private_t *priv = NULL; + + if (this == NULL) { + goto out; + } + + priv = this->private; + if (priv == NULL) { + goto out; + } + + qr_inode_table_destroy (priv); + qr_conf_destroy (&priv->conf); + + this->private = NULL; + + GF_FREE (priv); +out: return; } |