summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-04-21 03:32:00 +0000
committerVijay Bellur <vbellur@redhat.com>2014-04-28 04:02:03 -0700
commita7c8d514c0487019d218c327deb52f7d09645875 (patch)
tree24e7f5cb1ddf940c415a11abc15aa73a8bdf51ae /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
parentb46d0ba04901ebca81d0f477e3e9ac6ba8607946 (diff)
glusterd: Rename the export dictionary as peer_data
During a glusterd handshake, a dictionary is passed among the peers which contains, info of volumes, global opts, and now also info of snaps and list of missed snaps As it now contains more than just volume specific data, renaming the dict in the code-base from "vols" to "peer_data" Change-Id: Ib457172789ddd0d8978b08bceab0988c48e9eea7 BUG: 1061685 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7524 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index cf1ae279a00..09def19154b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -1242,12 +1242,12 @@ int32_t
glusterd_rpc_friend_add (call_frame_t *frame, xlator_t *this,
void *data)
{
- gd1_mgmt_friend_req req = {{0},};
- int ret = 0;
- glusterd_peerinfo_t *peerinfo = NULL;
- glusterd_conf_t *priv = NULL;
- glusterd_friend_sm_event_t *event = NULL;
- dict_t *vols = NULL;
+ gd1_mgmt_friend_req req = {{0},};
+ int ret = 0;
+ glusterd_peerinfo_t *peerinfo = NULL;
+ glusterd_conf_t *priv = NULL;
+ glusterd_friend_sm_event_t *event = NULL;
+ dict_t *peer_data = NULL;
if (!frame || !this || !data) {
@@ -1262,16 +1262,20 @@ glusterd_rpc_friend_add (call_frame_t *frame, xlator_t *this,
peerinfo = event->peerinfo;
- ret = glusterd_build_volume_dict (&vols);
- if (ret)
+ ret = glusterd_add_volumes_to_export_dict (&peer_data);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Unable to add list of volumes "
+ "in the peer_data dict for handshake");
goto out;
+ }
if (priv->op_version >= GD_OP_VERSION_4) {
- ret = glusterd_add_missed_snaps_to_export_dict (vols);
+ ret = glusterd_add_missed_snaps_to_export_dict (peer_data);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
"Unable to add list of missed snapshots "
- "in the vols dict for handshake");
+ "in the peer_data dict for handshake");
goto out;
}
}
@@ -1280,7 +1284,7 @@ glusterd_rpc_friend_add (call_frame_t *frame, xlator_t *this,
req.hostname = peerinfo->hostname;
req.port = peerinfo->port;
- ret = dict_allocate_and_serialize (vols, &req.vols.vols_val,
+ ret = dict_allocate_and_serialize (peer_data, &req.vols.vols_val,
&req.vols.vols_len);
if (ret)
goto out;
@@ -1294,8 +1298,8 @@ glusterd_rpc_friend_add (call_frame_t *frame, xlator_t *this,
out:
GF_FREE (req.vols.vols_val);
- if (vols)
- dict_unref (vols);
+ if (peer_data)
+ dict_unref (peer_data);
gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret);
return ret;