summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2019-04-08 18:54:46 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-04-11 15:19:30 +0000
commit7108913337f24d3d7a39d919a29872fe50072cf4 (patch)
tree826ecbcb91847225db611e6da5ea5767fab59b97 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c
parent35dd17e222fe172866e15824e5ac9d242382178c (diff)
glusterd: remove glusterd_check_volume_exists() call
As the same functionality is covered in glusterd_volinfo_find Updates: bz#1193929 Change-Id: I2308c5fa9b2ca9edaa95f172d0bd914103808c36 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index 5e8673640b6..fa3d620a4b0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -300,6 +300,7 @@ __glusterd_handle_create_volume(rpcsvc_request_t *req)
#else
char *addr_family = "inet";
#endif
+ glusterd_volinfo_t *volinfo = NULL;
GF_ASSERT(req);
@@ -353,7 +354,9 @@ __glusterd_handle_create_volume(rpcsvc_request_t *req)
goto out;
}
- if ((ret = glusterd_check_volume_exists(volname))) {
+ ret = glusterd_volinfo_find(volname, &volinfo);
+ if (!ret) {
+ ret = -1;
snprintf(err_str, sizeof(err_str), "Volume %s already exists", volname);
gf_msg(this->name, GF_LOG_ERROR, EEXIST, GD_MSG_VOL_ALREADY_EXIST, "%s",
err_str);
@@ -1136,7 +1139,6 @@ glusterd_op_stage_create_volume(dict_t *dict, char **op_errstr,
{
int ret = 0;
char *volname = NULL;
- gf_boolean_t exists = _gf_false;
char *bricks = NULL;
char *brick_list = NULL;
char *free_ptr = NULL;
@@ -1154,6 +1156,7 @@ glusterd_op_stage_create_volume(dict_t *dict, char **op_errstr,
uuid_t volume_uuid;
char *volume_uuid_str;
gf_boolean_t is_force = _gf_false;
+ glusterd_volinfo_t *volinfo = NULL;
this = THIS;
GF_ASSERT(this);
@@ -1168,8 +1171,8 @@ glusterd_op_stage_create_volume(dict_t *dict, char **op_errstr,
goto out;
}
- exists = glusterd_check_volume_exists(volname);
- if (exists) {
+ ret = glusterd_volinfo_find(volname, &volinfo);
+ if (!ret) {
snprintf(msg, sizeof(msg), "Volume %s already exists", volname);
ret = -1;
goto out;