summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/common-utils.c4
-rw-r--r--libglusterfs/src/ctx.c5
-rw-r--r--libglusterfs/src/fd.c4
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store.c1
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store_helper.c1
-rw-r--r--libglusterfs/src/inode.c2
-rw-r--r--libglusterfs/src/stack.c2
-rw-r--r--libglusterfs/src/statedump.c6
-rw-r--r--libglusterfs/src/syncop.c40
-rw-r--r--libglusterfs/src/syncop.h3
-rw-r--r--rpc/rpc-transport/rdma/src/name.c10
11 files changed, 15 insertions, 63 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index bd2cf35a52a..5d66e8d4207 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -750,7 +750,6 @@ xldump_subvolumes(xlator_t *this, void *d)
int len = 0;
char *subvstr = NULL;
- subv = this->children;
if (!this->children)
return;
@@ -2116,7 +2115,6 @@ gf_is_ip_in_net(const char *network, const char *ip_str)
else if (strchr(network, '.'))
family = AF_INET;
else {
- family = -1;
goto out;
}
@@ -2433,7 +2431,6 @@ valid_ipv4_address(char *address, int length, gf_boolean_t wildcard_acc)
goto out;
}
- prev = tmp;
prev = strtok_r(tmp, ".", &ptr);
while (prev != NULL) {
@@ -4323,7 +4320,6 @@ gf_backtrace_fillframes(char *buf)
fp = fdopen(fd, "r");
if (!fp) {
sys_close(fd);
- ret = -1;
goto out;
}
diff --git a/libglusterfs/src/ctx.c b/libglusterfs/src/ctx.c
index 1e4c341df05..170a5752452 100644
--- a/libglusterfs/src/ctx.c
+++ b/libglusterfs/src/ctx.c
@@ -17,14 +17,12 @@
glusterfs_ctx_t *
glusterfs_ctx_new()
{
- int ret = 0;
glusterfs_ctx_t *ctx = NULL;
/* no GF_CALLOC here, gf_acct_mem_set_enable is not
yet decided at this point */
ctx = calloc(1, sizeof(*ctx));
if (!ctx) {
- ret = -1;
goto out;
}
@@ -44,8 +42,7 @@ glusterfs_ctx_new()
#endif
/* lock is never destroyed! */
- ret = LOCK_INIT(&ctx->lock);
- if (ret) {
+ if (LOCK_INIT(&ctx->lock)) {
free(ctx);
ctx = NULL;
goto out;
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 6c521317110..25edcbdd387 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -1131,6 +1131,8 @@ fdentry_dump_to_dict(fdentry_t *fdentry, char *prefix, dict_t *dict,
snprintf(key, sizeof(key), "%s.flags", prefix);
ret = dict_set_int32(dict, key, fdentry->fd->flags);
+ if (ret)
+ return;
(*openfds)++;
}
@@ -1180,6 +1182,8 @@ fdtable_dump_to_dict(fdtable_t *fdtable, char *prefix, dict_t *dict)
snprintf(key, sizeof(key), "%s.fdtable.openfds", prefix);
ret = dict_set_int32(dict, key, openfds);
+ if (ret)
+ goto out;
out:
pthread_rwlock_unlock(&fdtable->lock);
diff --git a/libglusterfs/src/gfdb/gfdb_data_store.c b/libglusterfs/src/gfdb/gfdb_data_store.c
index 426596c571e..ab56a51d462 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store.c
+++ b/libglusterfs/src/gfdb/gfdb_data_store.c
@@ -267,7 +267,6 @@ init_db(dict_t *args, gfdb_db_type_t gfdb_db_type)
goto init_db_failed;
}
_conn_node->gfdb_connection.gfdb_db_type = gfdb_db_type;
- ret = 0;
return _conn_node;
diff --git a/libglusterfs/src/gfdb/gfdb_data_store_helper.c b/libglusterfs/src/gfdb/gfdb_data_store_helper.c
index fb01a6c699b..b1f79bc8dad 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store_helper.c
+++ b/libglusterfs/src/gfdb/gfdb_data_store_helper.c
@@ -313,7 +313,6 @@ gfdb_query_record_serialize(gfdb_query_record_t *query_record, char **in_buffer)
/* Copying the Footer of the record */
memcpy(buffer, &footer, sizeof(int32_t));
- buffer += sizeof(int32_t);
count += sizeof(int32_t);
out:
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index 8bfd5c70db8..b8e389ac140 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -2392,6 +2392,8 @@ inode_dump_to_dict(inode_t *inode, char *prefix, dict_t *dict)
snprintf(key, sizeof(key), "%s.ia_type", prefix);
ret = dict_set_int32(dict, key, inode->ia_type);
+ if (ret)
+ goto out;
out:
UNLOCK(&inode->lock);
diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c
index 4b5d13c3fc8..c06e2dc378d 100644
--- a/libglusterfs/src/stack.c
+++ b/libglusterfs/src/stack.c
@@ -327,6 +327,8 @@ gf_proc_dump_call_frame_to_dict(call_frame_t *call_frame, char *prefix,
if (tmp_frame.unwind_to) {
snprintf(key, sizeof(key), "%s.unwind_to", prefix);
ret = dict_set_dynstr(dict, key, gf_strdup(tmp_frame.unwind_to));
+ if (ret)
+ return;
}
return;
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index 0f4a7102697..ed5cad5349b 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -745,7 +745,7 @@ gf_proc_dump_options_init()
(void)gf_proc_dump_disable_all_options();
// swallow the errors if setting statedump file path is failed.
- ret = gf_proc_dump_set_path(dump_option_file);
+ (void)gf_proc_dump_set_path(dump_option_file);
ret = fscanf(fp, "%s", buf);
@@ -864,7 +864,7 @@ gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx)
timestr);
// swallow the errors of write for start and end marker
- ret = sys_write(gf_dump_fd, sign_string, len);
+ (void)sys_write(gf_dump_fd, sign_string, len);
memset(timestr, 0, sizeof(timestr));
@@ -914,7 +914,7 @@ gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx)
len = snprintf(sign_string, sizeof(sign_string), "\nDUMP-END-TIME: %s",
timestr);
- ret = sys_write(gf_dump_fd, sign_string, len);
+ (void)sys_write(gf_dump_fd, sign_string, len);
if (gf_dump_fd != -1)
gf_proc_dump_close();
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 18ce6cf73af..edf978d797d 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -3397,42 +3397,4 @@ syncop_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
__wake(args);
return 0;
-}
-
-int
-syncop_icreate(xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *xdata)
-{
- struct syncargs args = {
- 0,
- };
-
- SYNCOP(subvol, (&args), syncop_icreate_cbk, subvol->fops->icreate, loc,
- mode, xdata);
-
- if (xdata)
- xdata = args.xdata;
- else if (args.xdata)
- dict_unref(args.xdata);
-
- errno = args.op_errno;
- return args.op_ret;
-}
-
-int
-syncop_namelink(xlator_t *subvol, loc_t *loc, dict_t *xdata)
-{
- struct syncargs args = {
- 0,
- };
-
- SYNCOP(subvol, (&args), syncop_namelink_cbk, subvol->fops->namelink, loc,
- xdata);
-
- if (xdata)
- xdata = args.xdata;
- else if (args.xdata)
- dict_unref(args.xdata);
-
- errno = args.op_errno;
- return args.op_ret;
-}
+} \ No newline at end of file
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index cea52429f6f..88279d15490 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -630,9 +630,6 @@ int
syncop_icreate(xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *xdata_out);
int
-syncop_namelink(xlator_t *subvol, loc_t *loc, dict_t *xdata_out);
-
-int
syncop_entrylk(xlator_t *subvol, const char *volume, loc_t *loc,
const char *basename, entrylk_cmd cmd, entrylk_type type,
dict_t *xdata_in, dict_t **xdata_out);
diff --git a/rpc/rpc-transport/rdma/src/name.c b/rpc/rpc-transport/rdma/src/name.c
index e7d56fcc1a8..d57f2d4f58d 100644
--- a/rpc/rpc-transport/rdma/src/name.c
+++ b/rpc/rpc-transport/rdma/src/name.c
@@ -598,22 +598,16 @@ fill_inet6_inet_identifiers(rpc_transport_t *this,
int32_t one_to_four, four_to_eight, twelve_to_sixteen;
int16_t eight_to_ten, ten_to_twelve;
- one_to_four = four_to_eight = twelve_to_sixteen = 0;
- eight_to_ten = ten_to_twelve = 0;
-
one_to_four = sock_union.sin6.sin6_addr.s6_addr32[0];
four_to_eight = sock_union.sin6.sin6_addr.s6_addr32[1];
#ifdef GF_SOLARIS_HOST_OS
eight_to_ten = S6_ADDR16(sock_union.sin6.sin6_addr)[4];
-#else
- eight_to_ten = sock_union.sin6.sin6_addr.s6_addr16[4];
-#endif
-
-#ifdef GF_SOLARIS_HOST_OS
ten_to_twelve = S6_ADDR16(sock_union.sin6.sin6_addr)[5];
#else
+ eight_to_ten = sock_union.sin6.sin6_addr.s6_addr16[4];
ten_to_twelve = sock_union.sin6.sin6_addr.s6_addr16[5];
#endif
+
twelve_to_sixteen = sock_union.sin6.sin6_addr.s6_addr32[3];
/* ipv4 mapped ipv6 address has