summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKaleb S KEITHLEY <kkeithle@redhat.com>2015-12-19 20:27:17 -0500
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-02-15 01:32:26 -0800
commitd4c415776b20e4152d4a706276cb06d833a58baa (patch)
treebc80178ddacf38aa3237ae37697b24b598d50b6e /xlators
parent62f9659554c07317c9d06251b74171d9eac0917e (diff)
all: fixes for clang compile warnings
cli/src/cli-cmd-parser.c (chenk) cli/src/cli-xml-output.c (spandit) cli/src/cli.c (chenk) libglusterfs/src/common-utils.c (vmallika) libglusterfs/src/gfdb/gfdb_sqlite3.c (jfernand +1) rpc/rpc-transport/socket/src/socket.c (?) xlators/cluster/afr/src/afr-transaction.c (?) xlators/cluster/dht/src/dht-common.h (srangana +2) xlators/cluster/dht/src/dht-selfheal.c (srangana +2) xlators/debug/io-stats/src/io-stats.c (R. Wareing) xlators/features/barrier/src/barrier.c (vshastry) xlators/features/bit-rot/src/bitd/bit-rot-scrub.h (vshankar +1) xlators/features/shard/src/shard.c (kdhananj +1) xlators/mgmt/glusterd/src/glusterd-ganesha.c (skoduri) xlators/mgmt/glusterd/src/glusterd-handler.c (atinmu) xlators/mgmt/glusterd/src/glusterd-op-sm.h (atinmu) xlators/mgmt/glusterd/src/glusterd-snapshot.c (spandit) xlators/mgmt/glusterd/src/glusterd-syncop.c (atinmu) xlators/mgmt/glusterd/src/glusterd-volgen.c (atinmu) xlators/protocol/client/src/client-messages.h (mselvaga +1) xlators/storage/bd/src/bd-helper.c (M. Mohan Kumar) xlators/storage/bd/src/bd.c (M. Mohan Kumar) xlators/storage/posix/src/posix.c (nbalacha +1) Change-Id: I85934fbcaf485932136ef3acd206f6ebecde61dd BUG: 1293133 Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/13031 CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c2
-rw-r--r--xlators/cluster/dht/src/dht-common.h2
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c4
-rw-r--r--xlators/debug/io-stats/src/io-stats.c2
-rw-r--r--xlators/features/barrier/src/barrier.c2
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-scrub.h2
-rw-r--r--xlators/features/shard/src/shard.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-ganesha.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.h3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c2
-rw-r--r--xlators/protocol/client/src/client-messages.h4
-rw-r--r--xlators/storage/bd/src/bd-helper.c4
-rw-r--r--xlators/storage/bd/src/bd.c2
-rw-r--r--xlators/storage/posix/src/posix.c2
18 files changed, 26 insertions, 23 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 4c85a4b0d03..92f68b91113 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1401,7 +1401,7 @@ afr_lock_rec (call_frame_t *frame, xlator_t *this)
case AFR_ENTRY_TRANSACTION:
int_lock->lk_basename = local->transaction.basename;
- if (&local->transaction.parent_loc)
+ if (local->transaction.parent_loc.path)
int_lock->lk_loc = &local->transaction.parent_loc;
else
GF_ASSERT (local->fd);
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 22855b9425c..d9b52e28bb9 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -441,7 +441,7 @@ struct dht_conf {
int *last_event;
dht_layout_t **file_layouts;
dht_layout_t **dir_layouts;
- gf_boolean_t search_unhashed;
+ unsigned int search_unhashed;
gf_boolean_t lookup_optimize;
int gen;
dht_du_t *du_stats;
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index d7ee74224c6..1eef4bdb59e 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -442,7 +442,9 @@ dht_distribution_type (xlator_t *this, dht_layout_t *layout)
}
range = layout->list[i].stop - layout->list[i].start;
- diff = abs (range - start_range);
+ diff = (range >= start_range)
+ ? range - start_range
+ : start_range - range;
if ((range != 0) && (diff > layout->cnt)) {
type = GF_DHT_WEIGHTED_DISTRIBUTION;
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index eb604ea929b..79e97786581 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -1017,7 +1017,7 @@ _io_stats_write_latency_sample (xlator_t *this, ios_sample_t *sample,
epoch_time = (sample->timestamp).tv_sec +
((sample->timestamp).tv_usec / 1000000.0);
- if (!sample->identifier || (strlen (sample->identifier) == 0)) {
+ if (strlen (sample->identifier) == 0) {
hostname = "Unknown";
port = "Unknown";
} else {
diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c
index f3f62d6c2d9..ce3a255d93e 100644
--- a/xlators/features/barrier/src/barrier.c
+++ b/xlators/features/barrier/src/barrier.c
@@ -473,7 +473,7 @@ notify (xlator_t *this, int event, void *data, ...)
dict_t *dict = NULL;
gf_boolean_t past = _gf_false;
int ret = -1;
- gf_boolean_t barrier_enabled = _gf_false;
+ int barrier_enabled = _gf_false;
struct list_head queue = {0,};
priv = this->private;
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
index e730582f1f8..b27decd41c1 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
@@ -8,7 +8,7 @@
cases as published by the Free Software Foundation.
*/
-#ifndef __BIT_ROT__SCRUB_H__
+#ifndef __BIT_ROT_SCRUB_H__
#define __BIT_ROT_SCRUB_H__
#include "xlator.h"
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 19a07d29562..03d3449b49a 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -1475,7 +1475,7 @@ shard_truncate_do (call_frame_t *frame, xlator_t *this)
local = frame->local;
- if ((local->num_blocks == 1)) {
+ if (local->num_blocks == 1) {
/* This means that there are no shards to be unlinked.
* The fop boils down to truncating the last shard, updating
* the size and unwinding.
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
index d5e521d90bb..de1c33df5bf 100644
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
@@ -240,7 +240,7 @@ glusterd_op_stage_set_ganesha (dict_t *dict, char **op_errstr)
int ret = -1;
char *volname = NULL;
int exists = 0;
- gf_boolean_t value = _gf_false;
+ int value = -1;
gf_boolean_t option = _gf_false;
char *str = NULL;
int dict_count = 0;
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index c86587f6fbf..4a81ce25085 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -856,7 +856,7 @@ __glusterd_handle_cluster_lock (rpcsvc_request_t *req)
int32_t ret = -1;
gd1_mgmt_cluster_lock_req lock_req = {{0},};
glusterd_op_lock_ctx_t *ctx = NULL;
- glusterd_op_t op = GD_OP_EVENT_LOCK;
+ glusterd_op_sm_event_type_t op = GD_OP_EVENT_LOCK;
glusterd_op_info_t txn_op_info = {{0},};
glusterd_conf_t *priv = NULL;
uuid_t *txn_id = NULL;
@@ -947,9 +947,9 @@ glusterd_handle_cluster_lock (rpcsvc_request_t *req)
__glusterd_handle_cluster_lock);
}
-int
+static int
glusterd_req_ctx_create (rpcsvc_request_t *rpc_req,
- glusterd_op_t op, uuid_t uuid,
+ int op, uuid_t uuid,
char *buf_val, size_t buf_len,
gf_gld_mem_types_t mem_type,
glusterd_req_ctx_t **req_ctx_out)
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 076ae8ef56b..ea1400d7637 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -145,7 +145,7 @@ glusterd_txn_opinfo_dict_fini ()
void
glusterd_txn_opinfo_init (glusterd_op_info_t *opinfo,
- glusterd_op_sm_state_info_t *state, glusterd_op_t *op,
+ glusterd_op_sm_state_info_t *state, int *op,
dict_t *op_ctx, rpcsvc_request_t *req)
{
glusterd_conf_t *conf = NULL;
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.h b/xlators/mgmt/glusterd/src/glusterd-op-sm.h
index 454181d188f..19b1bd97e04 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.h
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.h
@@ -91,7 +91,8 @@ struct glusterd_op_info_ {
int32_t pending_count;
int32_t brick_pending_count;
int32_t op_count;
- glusterd_op_t op;
+ /* op is an enum, glusterd_op_t or glusterd_op_sm_state_info_t */
+ int op;
struct cds_list_head op_peers;
void *op_ctx;
rpcsvc_request_t *req;
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index cb1c8e951e5..e2b0ea21501 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -1196,7 +1196,7 @@ snap_max_hard_limits_validate (dict_t *dict, char *volname,
max_limit = opt_hard_max;
}
- if ((value < 0) || (value > max_limit)) {
+ if (value > max_limit) {
ret = -1;
snprintf (err_str, PATH_MAX, "Invalid snap-max-hard-limit "
"%"PRIu64 ". Expected range 1 - %"PRIu64,
@@ -1289,7 +1289,7 @@ glusterd_snapshot_config_prevalidate (dict_t *dict, char **op_errstr,
if (soft_limit) {
max_limit = GLUSTERD_SNAPS_MAX_SOFT_LIMIT_PERCENT;
- if ((soft_limit < 0) || (soft_limit > max_limit)) {
+ if (soft_limit > max_limit) {
ret = -1;
snprintf (err_str, PATH_MAX, "Invalid "
"snap-max-soft-limit ""%"
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index a0b856160c9..ac4870d516c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -1720,7 +1720,7 @@ gd_sync_task_begin (dict_t *op_ctx, rpcsvc_request_t * req)
int op_ret = -1;
dict_t *req_dict = NULL;
glusterd_conf_t *conf = NULL;
- glusterd_op_t op = 0;
+ glusterd_op_t op = GD_OP_NONE;
int32_t tmp_op = 0;
char *op_errstr = NULL;
char *tmp = NULL;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 3df4b3556cf..c808b07cbf2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3906,7 +3906,7 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
char *tmp = NULL;
gf_boolean_t var = _gf_false;
gf_boolean_t ob = _gf_false;
- gf_boolean_t uss_enabled = _gf_false;
+ int uss_enabled = -1;
xlator_t *this = THIS;
GF_ASSERT (this);
diff --git a/xlators/protocol/client/src/client-messages.h b/xlators/protocol/client/src/client-messages.h
index 923917643bf..0fc9d31729c 100644
--- a/xlators/protocol/client/src/client-messages.h
+++ b/xlators/protocol/client/src/client-messages.h
@@ -9,7 +9,7 @@
*/
#ifndef _PC_MESSAGES_H__
-#define _PC_MESSAGES_H_
+#define _PC_MESSAGES_H__
#ifndef _CONFIG_H
#define _CONFIG_H
@@ -621,4 +621,4 @@
/*------------*/
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
-#endif /* !_PC_MESSAGES_H_ */
+#endif /* !_PC_MESSAGES_H__ */
diff --git a/xlators/storage/bd/src/bd-helper.c b/xlators/storage/bd/src/bd-helper.c
index 8b4536f49d9..15f83d3f834 100644
--- a/xlators/storage/bd/src/bd-helper.c
+++ b/xlators/storage/bd/src/bd-helper.c
@@ -1010,9 +1010,9 @@ bd_do_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd,
}
}
- memcpy (&prebuf, &bdatt->iatt, sizeof (prebuf));
+ memcpy (prebuf, &bdatt->iatt, sizeof (struct iatt));
bd_update_amtime (&bdatt->iatt, GF_SET_ATTR_MTIME);
- memcpy (&postbuf, &bdatt->iatt, sizeof (postbuf));
+ memcpy (postbuf, &bdatt->iatt, sizeof (struct iatt));
out:
diff --git a/xlators/storage/bd/src/bd.c b/xlators/storage/bd/src/bd.c
index 115b01d4ea6..6c1d2a29308 100644
--- a/xlators/storage/bd/src/bd.c
+++ b/xlators/storage/bd/src/bd.c
@@ -120,7 +120,7 @@ bd_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
int ret = -1;
bd_attr_t *bdatt = NULL;
uint64_t size = 0;
- char *type = BD_TYPE_NONE;
+ char *type = NULL;
/* only regular files are part of BD object */
if (op_ret < 0 || buf->ia_type != IA_IFREG)
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index c74cf45fce1..314585ac41b 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3516,7 +3516,7 @@ posix_setxattr (call_frame_t *frame, xlator_t *this,
char *acl_xattr = NULL;
struct iatt stbuf = {0};
int32_t ret = 0;
- size_t acl_size = 0;
+ ssize_t acl_size = 0;
dict_t *xattr = NULL;
posix_xattr_filler_t filler = {0,};