diff options
author | Ravishankar N <ravishankar@redhat.com> | 2018-12-11 15:32:03 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-12-12 23:02:56 +0000 |
commit | 52d3f82db2f032eae1b60ffa2f283109858ce3df (patch) | |
tree | 2fa19f5f3838a8a3343a7a4b928007016960328d /xlators/cluster/afr/src/afr.c | |
parent | 607bbd935f102602810fdeb61079b85ecb58a118 (diff) |
afr: some minor itable related cleanups
- this->itable always needs to be allocated, hence move it outside
afr_selfheal_daemon_init().
- Invoke afr_selfheal_daemon_init() only for self-heal daemon case.
- remove redundant itable allocation in afr_discover().
- destroy itable in fini.
Updates bz#1193929
Change-Id: Ib28b50b607386f5a5aa7d2f743c8b506ccb10eae
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index c007ffef9f8..4e20c7542c3 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -559,12 +559,20 @@ init(xlator_t *this) goto out; } - ret = afr_selfheal_daemon_init(this); - if (ret) { + this->itable = inode_table_new(SHD_INODE_LRU_LIMIT, this); + if (!this->itable) { ret = -ENOMEM; goto out; } + if (priv->shd.iamshd) { + ret = afr_selfheal_daemon_init(this); + if (ret) { + ret = -ENOMEM; + goto out; + } + } + /* keep more local here as we may need them for self-heal etc */ this->local_pool = mem_pool_new(afr_local_t, 512); if (!this->local_pool) { @@ -593,7 +601,10 @@ fini(xlator_t *this) UNLOCK(&priv->lock); this->private = NULL; afr_priv_destroy(priv); - // if (this->itable);//I don't see any destroy func + if (this->itable) { + inode_table_destroy(this->itable); + this->itable = NULL; + } return; } |