summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
diff options
context:
space:
mode:
authornik-redhat <nladha@redhat.com>2020-07-28 11:45:09 +0530
committerSanju Rakonde <sanjurakonde@review.gluster.org>2020-08-18 09:31:04 +0000
commitad1d697d40db047c3024cb98b42839963bdbdf0f (patch)
tree52436a5af7368485f5584a36795095948e6fc8fe /xlators/mgmt/glusterd/src/glusterd-volume-ops.c
parentf5f94e574a8e27e4a6665567db30b82618115694 (diff)
glusterd: performance improvement
Issue: In the glusertd_op_stage_create_volume(), fetching of values from the dict is done, whereas same values are fetched by glusterd_check_brick_order() which is called from that function. This leads to unnecssary performance overhead. Fix: Instead of fetching the values again, passing the values to the glusterd_check_brick_order() if it's fethced before, else a NULL is passed and then only fetching is done here. Also, few changes are made to the code to reduce the cost of operations such as 'fast fail' for false conditions and a bit of code clean up. Fixes: #1397 Change-Id: Ic7b523adbca8eb63ef9eb29c206e3b19e05c0815 Signed-off-by: nik-redhat <nladha@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index cafdffb63c4..814ab14fb27 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -1002,7 +1002,8 @@ glusterd_op_stage_create_volume(dict_t *dict, char **op_errstr,
gf_msg_debug(this->name, 0,
"Replicate cluster type "
"found. Checking brick order.");
- ret = glusterd_check_brick_order(dict, msg, type,
+ ret = glusterd_check_brick_order(dict, msg, type, &volname,
+ &bricks, &brick_count,
replica_count);
} else if (type == GF_CLUSTER_TYPE_DISPERSE) {
ret = dict_get_int32n(dict, "disperse-count",
@@ -1016,7 +1017,8 @@ glusterd_op_stage_create_volume(dict_t *dict, char **op_errstr,
gf_msg_debug(this->name, 0,
"Disperse cluster type"
" found. Checking brick order.");
- ret = glusterd_check_brick_order(dict, msg, type,
+ ret = glusterd_check_brick_order(dict, msg, type, &volname,
+ &bricks, &brick_count,
disperse_count);
}
if (ret) {