diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-02-14 22:40:34 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-02-20 21:23:21 -0800 |
commit | 5f117a4a1fca3ec2d163fe77615cf6859c0450e4 (patch) | |
tree | 695913cadfb8d8fdacd240bf5e84dcb78a0cfdbc /xlators/cluster/afr/src/afr.c | |
parent | 8456c28af75a4083286fc6ceadc03f2703f4c9b6 (diff) |
cluster/afr: Self-heald, Index integration
Change-Id: Ic68eb00b356a6ee3cb88fe2bde50374be7a64ba3
BUG: 763820
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2749
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 18cd030f1..abc6aa3e5 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -30,6 +30,8 @@ #endif #include "afr-common.c" +#define SHD_INODE_LRU_LIMIT 100 + struct volume_options options[]; int32_t @@ -347,6 +349,33 @@ init (xlator_t *this) goto out; } + priv->shd.pending = GF_CALLOC (sizeof (*priv->shd.pending), child_count, + gf_afr_mt_afr_shd_bool_t); + if (!priv->shd.pending) { + ret = -ENOMEM; + goto out; + } + + priv->shd.inprogress = GF_CALLOC (sizeof (*priv->shd.inprogress), + child_count, + gf_afr_mt_afr_shd_bool_t); + if (!priv->shd.inprogress) { + ret = -ENOMEM; + goto out; + } + priv->shd.timer = GF_CALLOC (sizeof (*priv->shd.timer), child_count, + gf_afr_mt_afr_shd_timer_t); + if (!priv->shd.timer) { + ret = -ENOMEM; + goto out; + } + if (priv->shd.enabled) { + this->itable = inode_table_new (SHD_INODE_LRU_LIMIT, this); + if (!this->itable) { + ret = -ENOMEM; + goto out; + } + } priv->first_lookup = 1; priv->root_inode = NULL; |