summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c7
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c4
4 files changed, 11 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index b86580f9f0b..3a6445d8ace 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -4721,11 +4721,12 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
}
}
- if (strcmp (key, "cluster.max-op-version") == 0) {
+ if (strcmp (key, GLUSTERD_MAX_OP_VERSION_KEY) == 0) {
ret = glusterd_get_global_max_op_version (req, dict, 1);
if (ret)
goto out;
- } else if (strcmp (key, "cluster.op-version") == 0) {
+ } else if (strcmp (key,
+ GLUSTERD_GLOBAL_OP_VERSION_KEY) == 0) {
sprintf (dict_key, "key%d", count);
ret = dict_set_str(dict, dict_key, key);
if (ret) {
@@ -4958,7 +4959,7 @@ glusterd_print_global_options (dict_t *opts, char *key, data_t *val, void *data)
GF_VALIDATE_OR_GOTO (THIS->name, val, out);
GF_VALIDATE_OR_GOTO (THIS->name, data, out);
- if (strcmp (key, "global-option-version") == 0)
+ if (strcmp (key, GLUSTERD_GLOBAL_OPT_VERSION) == 0)
goto out;
fp = (FILE *) data;
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 6b12d603728..0ac64858c11 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -774,7 +774,6 @@ glusterd_validate_shared_storage (char *key, char *value, char *errstr)
char hook_script[PATH_MAX] = "";
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- struct stat stbuf = {0,};
this = THIS;
GF_VALIDATE_OR_GOTO ("glusterd", this, out);
@@ -806,7 +805,7 @@ glusterd_validate_shared_storage (char *key, char *value, char *errstr)
snprintf (hook_script, sizeof(hook_script),
"%s"GLUSTERD_SHRD_STRG_HOOK_SCRIPT, conf->workdir);
- ret = sys_lstat (hook_script, &stbuf);
+ ret = sys_access (hook_script, R_OK|X_OK);
if (ret) {
snprintf (errstr, PATH_MAX,
"The hook-script (%s) required "
@@ -900,7 +899,6 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
gf_boolean_t check_op_version = _gf_true;
gf_boolean_t trash_enabled = _gf_false;
gf_boolean_t all_vol = _gf_false;
- struct stat stbuf = {0, };
GF_ASSERT (dict);
this = THIS;
@@ -1128,7 +1126,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
/* Check if the key is cluster.op-version and set
* local_new_op_version to the value given if possible.
*/
- if (strcmp (key, "cluster.op-version") == 0) {
+ if (strcmp (key, GLUSTERD_GLOBAL_OP_VERSION_KEY) == 0) {
if (!all_vol) {
ret = -1;
snprintf (errstr, sizeof (errstr), "Option \""
@@ -1292,7 +1290,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr)
/* Checks whether a directory with
given option exists or not */
- if (!sys_stat (trash_path, &stbuf)) {
+ if (!sys_access (trash_path, R_OK)) {
snprintf (errstr,
sizeof (errstr),
"Path %s exists",
@@ -2508,7 +2506,7 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
/* If the key is cluster.op-version, set conf->op_version to the value
* if needed and save it.
*/
- if (strcmp(key, "cluster.op-version") == 0) {
+ if (strcmp(key, GLUSTERD_GLOBAL_OP_VERSION_KEY) == 0) {
ret = 0;
ret = gf_string2uint (value, &op_version);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index cf50e82e849..fce56b12e9c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -39,7 +39,7 @@
int32_t i = 0; \
\
if (!get_opt && (!strcmp (key, "all") || \
- !strcmp (key, "cluster.max-op-version"))) { \
+ !strcmp (key, GLUSTERD_MAX_OP_VERSION_KEY))) {\
ret = -1; \
*op_errstr = gf_strdup ("Not a valid option to set"); \
goto out; \
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 60a1d9be5fa..906fec07018 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -2859,12 +2859,12 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.value = BARRIER_TIMEOUT,
.op_version = GD_OP_VERSION_3_6_0,
},
- { .key = "cluster.op-version",
+ { .key = GLUSTERD_GLOBAL_OP_VERSION_KEY,
.voltype = "mgmt/glusterd",
.op_version = GD_OP_VERSION_3_6_0,
},
{
- .key = "cluster.max-op-version",
+ .key = GLUSTERD_MAX_OP_VERSION_KEY,
.voltype = "mgmt/glusterd",
.op_version = GD_OP_VERSION_3_10_0,
},