summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-common.h1
-rw-r--r--xlators/cluster/dht/src/dht-shared.c13
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c4
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c7
-rw-r--r--xlators/performance/write-behind/src/write-behind.c2
-rw-r--r--xlators/protocol/client/src/client-handshake.c5
6 files changed, 23 insertions, 9 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index f3e2c5cf41e..0b51dbac5e0 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -29,6 +29,7 @@
#define GF_XATTR_TIER_LAYOUT_FIXED_KEY "trusted.tier.fix.layout.complete"
#define GF_XATTR_FILE_MIGRATE_KEY "trusted.distribute.migrate-data"
#define DHT_MDS_STR "mds"
+#define GF_DHT_LOOKUP_UNHASHED_OFF 0
#define GF_DHT_LOOKUP_UNHASHED_ON 1
#define GF_DHT_LOOKUP_UNHASHED_AUTO 2
#define DHT_PATHINFO_HEADER "DISTRIBUTE:"
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c
index 38de31d1ec9..f6ca8bd0926 100644
--- a/xlators/cluster/dht/src/dht-shared.c
+++ b/xlators/cluster/dht/src/dht-shared.c
@@ -769,13 +769,18 @@ dht_init (xlator_t *this)
if (dict_get_str (this->options, "lookup-unhashed", &temp_str) == 0) {
/* If option is not "auto", other options _should_ be boolean */
if (strcasecmp (temp_str, "auto")) {
- ret = gf_string2boolean (temp_str,
- &conf->search_unhashed);
- if (ret == -1)
+ gf_boolean_t search_unhashed_bool;
+ ret = gf_string2boolean (temp_str, &search_unhashed_bool);
+ if (ret == -1) {
goto err;
+ }
+ conf->search_unhashed = search_unhashed_bool
+ ? GF_DHT_LOOKUP_UNHASHED_ON
+ : GF_DHT_LOOKUP_UNHASHED_OFF;
}
- else
+ else {
conf->search_unhashed = GF_DHT_LOOKUP_UNHASHED_AUTO;
+ }
}
GF_OPTION_INIT ("lookup-optimize", conf->lookup_optimize, bool, err);
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
index fc31dd2820b..a61ecab84d6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
@@ -968,13 +968,15 @@ gd_import_volume_snap_details (dict_t *dict, glusterd_volinfo_t *volinfo,
}
snprintf (key, sizeof (key), "%s.is_snap_volume", prefix);
- ret = dict_get_uint32 (dict, key, &volinfo->is_snap_volume);
+ uint32_t is_snap_int;
+ ret = dict_get_uint32 (dict, key, &is_snap_int);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
GD_MSG_DICT_GET_FAILED, "%s missing in payload "
"for %s", key, volname);
goto out;
}
+ volinfo->is_snap_volume = (is_snap_int != 0);
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.restored_from_snap", prefix);
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 6c6506009cb..50ac9931a5a 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -5583,8 +5583,11 @@ init (xlator_t *this_xl)
priv->direct_io_mode = 2;
ret = dict_get_str (options, ZR_DIRECT_IO_OPT, &value_string);
if (ret == 0) {
- ret = gf_string2boolean (value_string, &priv->direct_io_mode);
- GF_ASSERT (ret == 0);
+ gf_boolean_t direct_io_mode_bool;
+ ret = gf_string2boolean (value_string, &direct_io_mode_bool);
+ if (ret == 0) {
+ priv->direct_io_mode = direct_io_mode_bool ? 1 : 0;
+ }
}
GF_OPTION_INIT (ZR_STRICT_VOLFILE_CHECK, priv->strict_volfile_check,
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index d1a95c97d7a..67dd1f51ea1 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -251,7 +251,7 @@ wb_requests_overlap (wb_request_t *req1, wb_request_t *req2)
uint64_t r1_end = 0;
uint64_t r2_start = 0;
uint64_t r2_end = 0;
- enum _gf_boolean do_overlap = 0;
+ gf_boolean_t do_overlap = _gf_false;
r1_start = req1->ordering.off;
if (req1->ordering.size)
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index 3cf2b06cb03..6fdea91fa38 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -1179,7 +1179,8 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
goto out;
}
- ret = dict_get_uint32 (reply, "child_up", &conf->child_up);
+ uint32_t child_up_int;
+ ret = dict_get_uint32 (reply, "child_up", &child_up_int);
if (ret) {
/*
* This would happen in cases where the server trying to *
@@ -1189,6 +1190,8 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED,
"failed to find key 'child_up' in the options");
conf->child_up = _gf_true;
+ } else {
+ conf->child_up = (child_up_int != 0);
}
ret = dict_get_uint32 (reply, "clnt-lk-version", &lk_ver);