summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index f532a9c4714..8209e779c52 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4426,6 +4426,12 @@ glusterd_restart_gsyncds (glusterd_conf_t *conf)
return ret;
}
+int
+glusterd_calc_dist_leaf_count (int rcount, int scount)
+{
+ return (rcount ? rcount : 1) * (scount ? scount : 1);
+}
+
inline int
glusterd_get_dist_leaf_count (glusterd_volinfo_t *volinfo)
{
@@ -4435,7 +4441,7 @@ glusterd_get_dist_leaf_count (glusterd_volinfo_t *volinfo)
if (volinfo->type == GF_CLUSTER_TYPE_DISPERSE)
return volinfo->disperse_count;
- return (rcount ? rcount : 1) * (scount ? scount : 1);
+ return glusterd_calc_dist_leaf_count (rcount, scount);
}
int
@@ -5149,6 +5155,10 @@ out:
int
glusterd_is_defrag_on (glusterd_volinfo_t *volinfo)
{
+ /* Defrag is never enabled for tiered volumes. */
+ if (volinfo->type == GF_CLUSTER_TYPE_TIER)
+ return 0;
+
return (volinfo->rebal.defrag != NULL);
}