summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-09-06 00:13:04 +0530
committerAnand Avati <avati@redhat.com>2012-09-06 00:34:15 -0700
commitd6c99b6134f1eb90b3a8020c3538101df266e9b5 (patch)
treea5ec27bcf3136ddfda5ce5f21917bea50ad3be58 /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
parent54b71368ef290bc579f113e683a82b09893fb50a (diff)
libglusterfs/dict: make 'dict_t' a opaque object
* ie, don't dereference dict_t pointer, instead use APIs everywhere * other than dict_t only 'data_t' should be the valid export from dict.h * added 'dict_foreach_fnmatch()' API * changed dict_lookup() to use data_t, instead of data_pair_t Change-Id: I400bb0dd55519a7c5d2a107e67c8e7a7207228dc Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 850917 Reviewed-on: http://review.gluster.org/3829 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index a3522a98c51..491a3255ec5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -942,7 +942,7 @@ out:
}
-void
+int
_profile_volume_add_friend_rsp (dict_t *this, char *key, data_t *value,
void *data)
{
@@ -953,7 +953,7 @@ _profile_volume_add_friend_rsp (dict_t *this, char *key, data_t *value,
char brick_key[256];
if (strcmp (key, "count") == 0)
- return;
+ return 0;
sscanf (key, "%d%s", &brick_count, brick_key);
rsp_ctx = data;
new_value = data_copy (value);
@@ -961,6 +961,7 @@ _profile_volume_add_friend_rsp (dict_t *this, char *key, data_t *value,
snprintf (new_key, sizeof (new_key), "%d%s",
rsp_ctx->count + brick_count, brick_key);
dict_set (rsp_ctx->dict, new_key, new_value);
+ return 0;
}
int
@@ -995,7 +996,7 @@ out:
return ret;
}
-void
+int
glusterd_volume_status_add_peer_rsp (dict_t *this, char *key, data_t *value,
void *data)
{
@@ -1008,7 +1009,7 @@ glusterd_volume_status_add_peer_rsp (dict_t *this, char *key, data_t *value,
if (!strcmp (key, "count") || !strcmp (key, "cmd") ||
!strcmp (key, "brick-index-max") || !strcmp (key, "other-count"))
- return;
+ return -1;
rsp_ctx = data;
new_value = data_copy (value);
@@ -1029,7 +1030,7 @@ glusterd_volume_status_add_peer_rsp (dict_t *this, char *key, data_t *value,
gf_log ("", GF_LOG_ERROR, "Unable to set key: %s in dict",
key);
- return;
+ return 0;
}
int