diff options
| author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-09-08 13:04:45 +0530 |
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-10-12 04:57:06 -0700 |
| commit | 0ef62933649392051e73fe01c028e41baddec489 (patch) | |
| tree | ebdee384df69a04ebc061dfebc5aece1a870c8f4 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
| parent | d4bd690adae7ce69594c3322d0d7a8e3cb4f7303 (diff) | |
tier/shd: make shd commands compatible with tiering
tiering volfiles may contain afr and disperse together
or multiple time based on configuration. And the
informations for those configurations are stored in
tier_info. So most of the volgen code generation
need to be changed to make compatible with it.
Change-Id: I563d1ca6f281f59090ebd470b7fda1cc4b1b7e1d
BUG: 1261276
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12135
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 39518d1b534..e368147584f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -6368,14 +6368,24 @@ out: return ret; } +static inline int +is_replica_volume (int type) +{ + if (type == GF_CLUSTER_TYPE_REPLICATE || + type == GF_CLUSTER_TYPE_STRIPE_REPLICATE) + return 1; + return 0; +} gf_boolean_t glusterd_is_volume_replicate (glusterd_volinfo_t *volinfo) { gf_boolean_t replicates = _gf_false; - if (volinfo && ((volinfo->type == GF_CLUSTER_TYPE_REPLICATE) || - (volinfo->type == GF_CLUSTER_TYPE_STRIPE_REPLICATE))) - replicates = _gf_true; - return replicates; + if (volinfo->type == GF_CLUSTER_TYPE_TIER) { + replicates = is_replica_volume (volinfo->tier_info.cold_type) | + is_replica_volume (volinfo->tier_info.hot_type); + return replicates; + } + return is_replica_volume ((volinfo->type)); } gf_boolean_t |
