summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c11
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c31
3 files changed, 47 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index fcdfa608607..a6cf1319784 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -355,6 +355,11 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo,
if (ret)
goto out;
+ snprintf (key, 256, "volume%d.hot_brick_count", count);
+ ret = dict_set_int32 (volumes, key, volinfo->tier_info.hot_brick_count);
+ if (ret)
+ goto out;
+
snprintf (key, 256, "volume%d.dist_count", count);
ret = dict_set_int32 (volumes, key, volinfo->dist_leaf_count);
if (ret)
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index fbd74585229..858f0771ca6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -2673,6 +2673,7 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
int node_count = 0;
int brick_index = -1;
int other_count = 0;
+ int hot_brick_count = -1;
int other_index = 0;
uint32_t cmd = 0;
char *volname = NULL;
@@ -2904,6 +2905,16 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
}
}
+ if (volinfo->type == GF_CLUSTER_TYPE_TIER)
+ hot_brick_count = volinfo->tier_info.hot_brick_count;
+ ret = dict_set_int32 (rsp_dict, "hot_brick_count", hot_brick_count);
+ if (ret)
+ goto out;
+
+ ret = dict_set_int32 (rsp_dict, "type", volinfo->type);
+ if (ret)
+ goto out;
+
ret = dict_set_int32 (rsp_dict, "brick-index-max", brick_index);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index a22bc3ba7df..f38c16fa9a6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -7389,6 +7389,8 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)
int32_t node_count = 0;
int32_t other_count = 0;
int32_t brick_index_max = -1;
+ int32_t hot_brick_count = -1;
+ int32_t type = -1;
int32_t rsp_node_count = 0;
int32_t rsp_other_count = 0;
int vol_count = -1;
@@ -7485,6 +7487,35 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)
goto out;
}
+ ret = dict_get_int32 (rsp_dict, "hot_brick_count", &hot_brick_count);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "Failed to get hot brick count from rsp_dict");
+ goto out;
+ }
+
+ ret = dict_set_int32 (ctx_dict, "hot_brick_count",
+ node_count + rsp_node_count);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "Failed to update hot_brick_count");
+ goto out;
+ }
+
+ ret = dict_get_int32 (rsp_dict, "type", &type);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "Failed to get type from rsp_dict");
+ goto out;
+ }
+
+ ret = dict_set_int32 (ctx_dict, "type", type);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "Failed to update type");
+ goto out;
+ }
+
aggregate_tasks:
/* Tasks are only present for a normal status command for a volume or
* for an explicit tasks status command for a volume