summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 18cd030f1d4..abc6aa3e567 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;