From 5f117a4a1fca3ec2d163fe77615cf6859c0450e4 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 14 Feb 2012 22:40:34 +0530 Subject: cluster/afr: Self-heald, Index integration Change-Id: Ic68eb00b356a6ee3cb88fe2bde50374be7a64ba3 BUG: 763820 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/2749 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'xlators/cluster/afr/src/afr.c') 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; -- cgit