summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorMeghana Madhusudhan <mmadhusu@redhat.com>2015-03-18 11:33:50 +0530
committerNiels de Vos <ndevos@redhat.com>2015-03-18 01:53:22 -0700
commit368dfd695928e8fc40988b8f2de86c3b469172d2 (patch)
tree47beddb1ad9ad51c79e54d77e55a262d5998b81f /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent260a6943849f99227248a8fc852a8c8fc3d1e289 (diff)
NFS-Ganesha: Volume set option for managing NFS-Ganesha exports.
A dummy translator has been introduced as a place holder for functions related to managing NFS-Ganesha exports. A volume set option is introduced to manage volume level exports. gluster vol set <volname> ganesha.enable ON/OFF 1. gluster volume set <volname> ganesha.enable ON It creates the export config file with a unique export ID. Sends a DBus signal to export this volume dynamically. 2. gluster vol set <volname> ganesha.enable OFF Unexports the specific volume. Deletes the specfic config file related to the volume. This change also removes the handling of the older keys "nfs-ganesha.enable" and "nfs-ganesha.host" Change-Id: I8d4a0b542326a6a0c8e4711600b106274d666587 BUG: 1188184 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/9585 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index f20490423f6..c140e680261 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3318,6 +3318,25 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
}
}
+ ret = dict_get_str_boolean (set_dict, "ganesha.enable", _gf_false);
+
+ if (ret == -1) {
+ gf_log (this->name, GF_LOG_WARNING, "setting ganesha.enable"
+ "option failed.");
+ goto out;
+ }
+
+ if (ret) {
+ xl = volgen_graph_add (graph, "features/ganesha", volname);
+
+ if (!xl) {
+ gf_log (this->name, GF_LOG_ERROR, "failed to add"
+ "add features/ganesha to graph");
+ ret = -1;
+ goto out;
+ }
+ }
+
/* add debug translators depending on the options */
ret = check_and_add_debug_xl (graph, set_dict, volname,
"client");
@@ -3535,35 +3554,8 @@ nfs_option_handler (volgen_graph_t *graph,
return -1;
}
- if (! strcmp (vme->option, "!nfs-ganesha.enable")) {
- ret = gf_asprintf (&aa, "nfs-ganesha.%s.enable",
- volinfo->volname);
-
- if (ret != -1) {
- ret = xlator_set_option (xl, aa, vme->value);
- GF_FREE (aa);
- }
-
- if (ret)
- return -1;
- }
-
- if (! strcmp (vme->option, "!nfs-ganesha.host")) {
- ret = gf_asprintf (&aa, "nfs-ganesha.%s.host",
- volinfo->volname);
-
- if (ret != -1) {
- ret = xlator_set_option (xl, aa, vme->value);
- GF_FREE (aa);
- }
-
- if (ret)
- return -1;
- }
-
-
- if ( (strcmp (vme->voltype, "nfs/server") == 0) &&
+ if ((strcmp (vme->voltype, "nfs/server") == 0) &&
(vme->option && vme->option[0]!='!') ) {
ret = xlator_set_option (xl, vme->option, vme->value);
if (ret)