summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-08-23 03:51:21 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-23 02:53:16 -0700
commitdf4a7d75765b042ddbda4cbcd419743a37767ec3 (patch)
tree4a04c3720ad869869deb3d7d42c63252b2d7772a /xlators/mgmt/glusterd/src/glusterd3_1-mops.c
parent39dc05e370286a62428a94e3e7666e2eedaea941 (diff)
glusterd: support for volume version and cksumv3.1.0qa8
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1310 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1310
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd3_1-mops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
index 2c5cb8f33ab..5196055b3e1 100644
--- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
+++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
@@ -639,6 +639,7 @@ glusterd3_1_friend_add (call_frame_t *frame, xlator_t *this,
glusterd_conf_t *priv = NULL;
glusterd_friend_sm_event_t *event = NULL;
glusterd_friend_req_ctx_t *ctx = NULL;
+ dict_t *vols = NULL;
if (!frame || !this || !data) {
@@ -655,15 +656,32 @@ glusterd3_1_friend_add (call_frame_t *frame, xlator_t *this,
peerinfo = event->peerinfo;
+ ret = glusterd_build_volume_dict (&vols);
+ if (ret)
+ goto out;
+
uuid_copy (req.uuid, priv->uuid);
req.hostname = gf_strdup (peerinfo->hostname);
req.port = peerinfo->port;
+
+ ret = dict_allocate_and_serialize (vols, &req.vols.vols_val,
+ (size_t *)&req.vols.vols_len);
+ if (ret)
+ goto out;
+
ret = glusterd_submit_request (peerinfo, &req, frame, priv->mgmt,
GD_MGMT_FRIEND_ADD,
NULL, gd_xdr_from_mgmt_friend_req,
this, glusterd3_1_friend_add_cbk);
+
out:
+ if (req.vols.vols_val)
+ GF_FREE (req.vols.vols_val);
+
+ if (vols)
+ dict_destroy (vols);
+
gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
}