diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2014-04-28 14:18:50 +0000 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2014-04-28 14:18:50 +0000 |
commit | e139b4d0ba2286c0d4d44ba81260c2b287016019 (patch) | |
tree | 0a21f0761528e0f79da0a9f67106eb128ace0cf7 /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | |
parent | 73b60c87ca7f62517a8466431f5a8cf167589c8c (diff) | |
parent | f2bac9f9d5b9956969ddd25a54bc636b82f6923e (diff) |
Conflicts:
rpc/xdr/src/glusterfs3-xdr.c
rpc/xdr/src/glusterfs3-xdr.h
xlators/features/changelog/src/Makefile.am
xlators/features/changelog/src/changelog-helpers.h
xlators/features/changelog/src/changelog.c
xlators/mgmt/glusterd/src/glusterd-sm.c
Change-Id: I9972a5e6184503477eb77a8b56c50a4db4eec3e2
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index 27910d132..babd5a3be 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,15 +1262,37 @@ 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 (peer_data); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Unable to add list of missed snapshots " + "in the peer_data dict for handshake"); + goto out; + } + + ret = glusterd_add_snapshots_to_export_dict (peer_data); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Unable to add list of snapshots " + "in the peer_data dict for handshake"); + goto out; + } + } uuid_copy (req.uuid, MY_UUID); 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; @@ -1284,8 +1306,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; |