summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2017-02-03 15:55:47 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-02-07 00:12:29 -0500
commitf2133923b8d8851943c5676b88c5ce67725eabe5 (patch)
tree2a2651748582fc67227456c04d7091695ee841dc /xlators/mgmt/glusterd/src/glusterd-brick-ops.c
parenta3a38bb9cd2c17bd955489ae87800f398ef10239 (diff)
Tier: remove warning related to the enum
PROBLEM: In the tier as a service patch the enums for tier (from gf1_op_command and gf_defrag_command) are put into a single enum gf_defrag_command which causes a warning that will make the build fail. FIX: send both the enum and eliminate the warning. Change-Id: I899ff622dfb07134e6459aa65f65ea7252765293 BUG: 1418973 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: https://review.gluster.org/16539 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: hari gowtham <hari.gowtham005@gmail.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 7b5264ad8a1..3e358e95795 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1938,7 +1938,8 @@ int
glusterd_remove_brick_validate_bricks (gf1_op_commands cmd, int32_t brick_count,
dict_t *dict,
glusterd_volinfo_t *volinfo,
- char **errstr)
+ char **errstr,
+ gf_cli_defrag_type cmd_defrag)
{
char *brick = NULL;
char msg[2048] = {0,};
@@ -1986,7 +1987,7 @@ glusterd_remove_brick_validate_bricks (gf1_op_commands cmd, int32_t brick_count,
}
if (cmd == GF_OP_CMD_DETACH_COMMIT ||
- cmd == GF_DEFRAG_CMD_DETACH_COMMIT) {
+ cmd_defrag == GF_DEFRAG_CMD_DETACH_COMMIT) {
snprintf (msg, sizeof (msg), "Bricks in Hot "
"tier are not decommissioned yet. Use "
"gluster volume tier <VOLNAME> "
@@ -1997,7 +1998,7 @@ glusterd_remove_brick_validate_bricks (gf1_op_commands cmd, int32_t brick_count,
}
} else {
if ((cmd == GF_OP_CMD_DETACH_COMMIT ||
- (cmd == GF_DEFRAG_CMD_DETACH_COMMIT)) &&
+ (cmd_defrag == GF_DEFRAG_CMD_DETACH_COMMIT)) &&
(volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_STARTED)) {
snprintf (msg, sizeof (msg), "Bricks in Hot "
"tier are not decommissioned yet. Wait for "
@@ -2013,11 +2014,20 @@ glusterd_remove_brick_validate_bricks (gf1_op_commands cmd, int32_t brick_count,
switch (cmd) {
case GF_OP_CMD_START:
case GF_OP_CMD_DETACH_START:
+ goto check;
+ case GF_OP_CMD_NONE:
+ default:
+ break;
+ }
+
+ switch (cmd_defrag) {
case GF_DEFRAG_CMD_DETACH_START:
break;
+ case GF_DEFRAG_CMD_NONE:
default:
continue;
}
+check:
if (brickinfo->status != GF_BRICK_STARTED) {
snprintf (msg, sizeof (msg), "Found stopped "
"brick %s", brick);
@@ -2226,7 +2236,8 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
ret = glusterd_remove_brick_validate_bricks (cmd, brick_count,
dict, volinfo,
- &errstr);
+ &errstr,
+ GF_DEFRAG_CMD_NONE);
if (ret)
goto out;
@@ -2279,7 +2290,8 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
ret = glusterd_remove_brick_validate_bricks (cmd, brick_count,
dict, volinfo,
- &errstr);
+ &errstr,
+ GF_DEFRAG_CMD_NONE);
if (ret)
goto out;
@@ -2309,7 +2321,8 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
ret = glusterd_remove_brick_validate_bricks (cmd, brick_count,
dict, volinfo,
- &errstr);
+ &errstr,
+ GF_DEFRAG_CMD_NONE);
if (ret)
goto out;