summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2013-08-09 16:04:29 -0400
committerKrishnan Parthasarathi <kparthas@redhat.com>2013-08-12 00:48:15 +0530
commit6490660a439df29b15d9c0d16d1e5a3174d0017b (patch)
treec4148d5bfc2d5aae05490c22fccb6db6bd146cdc /xlators/mgmt
parentd25163a846f1fdcfe58a491c1f03fef51bb232ef (diff)
glusterd, quotad: volume-id option fixups
A few little hacks to set the volume id on the quota server and a mapping option on quotad to map the volume name to the uuid passed via the lookup request. Change-Id: Ic151acb18ed29d2ee4ae5d1bc6841ae4a4de176a Original-author: Brian Foster <bfoster@redhat.com> Signed-off-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 0119cae8..72e87c10 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1611,6 +1611,9 @@ server_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
xl = volgen_graph_add (graph, "features/quota", volname);
if (!xl)
return -1;
+ ret = xlator_set_option (xl, "volume-uuid", volume_id);
+ if (ret)
+ return -1;
ret = glusterd_volinfo_get (volinfo, VKEY_FEATURES_QUOTA, &value);
if (value) {
@@ -3145,6 +3148,7 @@ build_quotad_graph (volgen_graph_t *graph, dict_t *mod_dict)
dict_t *set_dict = NULL;
int ret = 0;
xlator_t *quotad_xl = NULL;
+ char *skey = NULL;
this = THIS;
priv = this->private;
@@ -3177,6 +3181,16 @@ build_quotad_graph (volgen_graph_t *graph, dict_t *mod_dict)
if (mod_dict)
dict_copy (mod_dict, set_dict);
+ ret = gf_asprintf(&skey, "%s.volume-id", voliter->volname);
+ if (ret == -1) {
+ gf_log("", GF_LOG_ERROR, "Out of memory");
+ goto out;
+ }
+ ret = xlator_set_option(quotad_xl, skey, uuid_utoa(voliter->volume_id));
+ GF_FREE(skey);
+ if (ret)
+ goto out;
+
memset (&cgraph, 0, sizeof (cgraph));
ret = volgen_graph_build_clients (&cgraph, voliter, set_dict,
NULL);