summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2016-08-22 12:11:24 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-08-29 09:21:56 -0700
commitae2ddb59381c37d79b4f1ce13028f02e9fffea47 (patch)
treed55b3fa9efc9302bc3bfddbe134fb25959cafb1b
parent4640061a357632258541141163764314993e40ca (diff)
core: fix unused variable warnings/errors
http://review.gluster.org/14085 fixes a/the "leak" - via the generated rpc/xdr headers - of pragmas that mask these warnings. However 14085 won't pass the smoke test until all the warnings are fixed. Change-Id: I3d8a7a3de35058aa97eab59d3f59208396298b03 BUG: 1369124 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/15246 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com>
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-api.c5
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-journal-handler.c9
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-reborp.c3
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-rpc.c1
-rw-r--r--xlators/features/changelog/lib/src/gf-history-changelog.c5
-rw-r--r--xlators/features/changelog/src/changelog-ev-handle.c12
-rw-r--r--xlators/features/changelog/src/changelog-helpers.c2
-rw-r--r--xlators/features/changelog/src/changelog-rpc-common.c1
-rw-r--r--xlators/features/changelog/src/changelog.c8
9 files changed, 6 insertions, 40 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog-api.c b/xlators/features/changelog/lib/src/gf-changelog-api.c
index d2a28bc6d52..71312f4ce95 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-api.c
+++ b/xlators/features/changelog/lib/src/gf-changelog-api.c
@@ -152,9 +152,7 @@ out:
ssize_t
gf_changelog_scan ()
{
- int ret = 0;
int tracker_fd = 0;
- size_t len = 0;
size_t off = 0;
xlator_t *this = NULL;
size_t nr_entries = 0;
@@ -181,9 +179,6 @@ gf_changelog_scan ()
if (gf_ftruncate (tracker_fd, 0))
goto out;
- len = offsetof(struct dirent, d_name)
- + pathconf(jnl->jnl_processing_dir, _PC_NAME_MAX) + 1;
-
rewinddir (jnl->jnl_dir);
for (;;) {
diff --git a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c
index 6ea7cac88da..2f197eed318 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c
+++ b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c
@@ -647,7 +647,6 @@ gf_changelog_consume (xlator_t *this,
void *
gf_changelog_process (void *data)
{
- int ret = 0;
xlator_t *this = NULL;
gf_changelog_journal_t *jnl = NULL;
gf_changelog_entry_t *entry = NULL;
@@ -675,8 +674,8 @@ gf_changelog_process (void *data)
pthread_mutex_unlock (&jnl_proc->lock);
if (entry) {
- ret = gf_changelog_consume (this, jnl,
- entry->path, _gf_false);
+ (void) gf_changelog_consume (this, jnl,
+ entry->path, _gf_false);
GF_FREE (entry);
}
}
@@ -715,7 +714,6 @@ void
gf_changelog_handle_journal (void *xl, char *brick,
void *cbkdata, changelog_event_t *event)
{
- int ret = 0;
gf_changelog_journal_t *jnl = NULL;
gf_changelog_processor_t *jnl_proc = NULL;
@@ -974,11 +972,8 @@ gf_changelog_init_history (xlator_t *this,
void
gf_changelog_journal_fini (void *xl, char *brick, void *data)
{
- int ret = 0;
- xlator_t *this = NULL;
gf_changelog_journal_t *jnl = NULL;
- this = xl;
jnl = data;
gf_changelog_cleanup_processor (jnl);
diff --git a/xlators/features/changelog/lib/src/gf-changelog-reborp.c b/xlators/features/changelog/lib/src/gf-changelog-reborp.c
index 8fd01d0c77a..4337d2575a9 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-reborp.c
+++ b/xlators/features/changelog/lib/src/gf-changelog-reborp.c
@@ -101,7 +101,6 @@ gf_changelog_reborp_rpcsvc_notify (rpcsvc_t *rpc, void *mydata,
{
int ret = 0;
xlator_t *this = NULL;
- gf_private_t *priv = NULL;
gf_changelog_t *entry = NULL;
if (!(event == RPCSVC_EVENT_ACCEPT ||
@@ -110,7 +109,6 @@ gf_changelog_reborp_rpcsvc_notify (rpcsvc_t *rpc, void *mydata,
entry = mydata;
this = entry->this;
- priv = this->private;
switch (event) {
case RPCSVC_EVENT_ACCEPT:
@@ -236,7 +234,6 @@ pick_event_unordered (struct gf_event_list *ev, struct gf_event **event)
void *
gf_changelog_callback_invoker (void *arg)
{
- int ret = 0;
xlator_t *this = NULL;
gf_changelog_t *entry = NULL;
struct iovec *vec = NULL;
diff --git a/xlators/features/changelog/lib/src/gf-changelog-rpc.c b/xlators/features/changelog/lib/src/gf-changelog-rpc.c
index 270632bc71b..b9339a770d1 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-rpc.c
+++ b/xlators/features/changelog/lib/src/gf-changelog-rpc.c
@@ -57,7 +57,6 @@ gf_probe_changelog_cbk (struct rpc_req *req,
int
gf_probe_changelog_filter (call_frame_t *frame, xlator_t *this, void *data)
{
- int ret = 0;
char *sock = NULL;
gf_changelog_t *entry = NULL;
changelog_probe_req req = {0,};
diff --git a/xlators/features/changelog/lib/src/gf-history-changelog.c b/xlators/features/changelog/lib/src/gf-history-changelog.c
index 45f2d8ba9f3..0c2320097d4 100644
--- a/xlators/features/changelog/lib/src/gf-history-changelog.c
+++ b/xlators/features/changelog/lib/src/gf-history-changelog.c
@@ -214,9 +214,7 @@ out:
ssize_t
gf_history_changelog_scan ()
{
- int ret = 0;
int tracker_fd = 0;
- size_t len = 0;
size_t off = 0;
xlator_t *this = NULL;
size_t nr_entries = 0;
@@ -258,9 +256,6 @@ gf_history_changelog_scan ()
if (gf_ftruncate (tracker_fd, 0))
goto out;
- len = offsetof (struct dirent, d_name)
- + pathconf (hist_jnl->jnl_processing_dir, _PC_NAME_MAX) + 1;
-
rewinddir (hist_jnl->jnl_dir);
for (;;) {
diff --git a/xlators/features/changelog/src/changelog-ev-handle.c b/xlators/features/changelog/src/changelog-ev-handle.c
index 77637c7beec..7fa6a89ea98 100644
--- a/xlators/features/changelog/src/changelog-ev-handle.c
+++ b/xlators/features/changelog/src/changelog-ev-handle.c
@@ -74,7 +74,6 @@ changelog_dispatch_vec (call_frame_t *frame, xlator_t *this,
int idx = 0;
int count = 0;
int ret = 0;
- unsigned long range = 0;
unsigned long sequence = 0;
rbuf_iovec_t *rvec = NULL;
struct ev_rpc *erpc = NULL;
@@ -83,7 +82,7 @@ changelog_dispatch_vec (call_frame_t *frame, xlator_t *this,
/* dispatch NR_IOVEC IO vectors at a time. */
erpc = data;
- RLIST_GET_SEQ (erpc->rlist, sequence, range);
+ sequence = erpc->rlist->seq[0];
rlist_iter_init (&riter, erpc->rlist);
@@ -232,7 +231,6 @@ changelog_ev_connector (void *data)
void
changelog_ev_cleanup_connections (xlator_t *this, changelog_clnt_t *c_clnt)
{
- int ret = 0;
changelog_rpc_clnt_t *crpc = NULL;
/* cleanup active connections */
@@ -287,11 +285,9 @@ put_client (changelog_clnt_t *c_clnt, changelog_rpc_clnt_t *crpc)
void
_dispatcher (rbuf_list_t *rlist, void *arg)
{
- int ret = 0;
xlator_t *this = NULL;
changelog_clnt_t *c_clnt = NULL;
changelog_rpc_clnt_t *crpc = NULL;
- changelog_rpc_clnt_t *tmp = NULL;
struct ev_rpc erpc = {0,};
struct list_head *next = NULL;
@@ -306,9 +302,9 @@ _dispatcher (rbuf_list_t *rlist, void *arg)
if (!crpc)
break;
erpc.rpc = crpc->rpc;
- ret = changelog_invoke_rpc (this, crpc->rpc,
- &changelog_ev_program,
- CHANGELOG_REV_PROC_EVENT, &erpc);
+ (void) changelog_invoke_rpc (this, crpc->rpc,
+ &changelog_ev_program,
+ CHANGELOG_REV_PROC_EVENT, &erpc);
put_client (c_clnt, crpc);
}
}
diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c
index 0cb68587e57..1e045f7a780 100644
--- a/xlators/features/changelog/src/changelog-helpers.c
+++ b/xlators/features/changelog/src/changelog-helpers.c
@@ -165,7 +165,6 @@ int
changelog_cleanup_event_selection (xlator_t *this,
changelog_ev_selector_t *selection)
{
- int ret = 0;
int j = CHANGELOG_EV_SELECTION_RANGE;
LOCK (&selection->reflock);
@@ -392,7 +391,6 @@ update_path (xlator_t *this, char *cl_path)
char low_cl[] = "changelog";
char up_cl[] = "CHANGELOG";
char *found = NULL;
- int iter = 0;
int ret = -1;
found = strstr(cl_path, up_cl);
diff --git a/xlators/features/changelog/src/changelog-rpc-common.c b/xlators/features/changelog/src/changelog-rpc-common.c
index 4525923d34d..c0744ef6218 100644
--- a/xlators/features/changelog/src/changelog-rpc-common.c
+++ b/xlators/features/changelog/src/changelog-rpc-common.c
@@ -282,7 +282,6 @@ rpcsvc_t *
changelog_rpc_server_init (xlator_t *this, char *sockfile, void *cbkdata,
rpcsvc_notify_t fn, struct rpcsvc_program **progs)
{
- int j = 0;
int ret = 0;
rpcsvc_t *rpc = NULL;
dict_t *options = NULL;
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index f8f95cf0e81..a2d18ac4d61 100644
--- a/xlators/features/changelog/src/changelog.c
+++ b/xlators/features/changelog/src/changelog.c
@@ -1877,9 +1877,6 @@ changelog_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, fd_t *fd, dict_t *xdata)
{
int ret = 0;
- void *opaque = NULL;
- char *buf = NULL;
- ssize_t buflen = 0;
changelog_priv_t *priv = NULL;
changelog_event_t ev = {0,};
gf_boolean_t logopen = _gf_false;
@@ -2041,8 +2038,6 @@ changelog_assign_barrier_timeout(changelog_priv_t *priv, uint32_t timeout)
static void
changelog_cleanup_helper_threads (xlator_t *this, changelog_priv_t *priv)
{
- int ret = 0;
-
if (priv->cr.rollover_th) {
(void) changelog_thread_cleanup (this, priv->cr.rollover_th);
priv->cr.rollover_th = 0;
@@ -2059,7 +2054,6 @@ static int
changelog_spawn_helper_threads (xlator_t *this, changelog_priv_t *priv)
{
int ret = 0;
- int flags = 0;
/* Geo-Rep snapshot dependency:
*
@@ -2752,7 +2746,6 @@ changelog_cleanup_rpc (xlator_t *this, changelog_priv_t *priv)
static int
changelog_init_rpc (xlator_t *this, changelog_priv_t *priv)
{
- int ret = 0;
rpcsvc_t *rpc = NULL;
changelog_ev_selector_t *selection = NULL;
@@ -2786,7 +2779,6 @@ int32_t
init (xlator_t *this)
{
int ret = -1;
- char *tmp = NULL;
changelog_priv_t *priv = NULL;
GF_VALIDATE_OR_GOTO ("changelog", this, error_return);