diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2011-09-02 17:23:03 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-04 10:11:57 -0700 |
commit | f9fa468090bd29cea38458ea2605a11c10909ab1 (patch) | |
tree | 6971fcc93404a5414f11ebf7309ce4d6dc267bb0 | |
parent | d120020fd5a0deb209be23da3ba936297f682c18 (diff) |
mgmt/glusterd: call the nfs opt handler at right placev3.1.7qa3
Change-Id: I4d25f5588b6def42a53488c42381f028d0884713
BUG: 3414
Reviewed-on: http://review.gluster.com/337
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index dfe7350548a..7a11b02e3ed 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -1804,7 +1804,7 @@ nfs_option_handler (glusterfs_graph_t *graph, return -1; } - if (! strcmp (vme->option, "!rpc-auth.addr.%s.reject")) { + if (! strcmp (vme->option, "!rpc-auth.addr.*.reject")) { ret = gf_asprintf (&aa, "rpc-auth.addr.%s.reject", volinfo->volname); @@ -1842,7 +1842,7 @@ nfs_option_handler (glusterfs_graph_t *graph, return -1; } - if (! strcmp (vme->option, "!nfs3.%s.trusted-sync")) { + if (! strcmp (vme->option, "!nfs3.*.trusted-sync")) { ret = gf_asprintf (&aa, "nfs3.%s.trusted-sync", volinfo->volname); @@ -1923,6 +1923,13 @@ nfs_option_handler (glusterfs_graph_t *graph, return -1; } + if ( (strcmp (vme->voltype, "nfs/server") == 0) && + (vme->option && vme->option[0]!='!') ) { + ret = xlator_set_option (xl, vme->option, vme->value); + if (ret) + return -1; + } + /*key = strchr (vme->key, '.') + 1; @@ -1940,18 +1947,6 @@ nfs_option_handler (glusterfs_graph_t *graph, return 0; } -static int -nfs_spec_option_handler (glusterfs_graph_t *graph, - struct volopt_map_entry *vme, void *param) -{ - int ret = 0; - - ret = nfs_option_handler (graph, vme, param); - if (!ret) - return basic_option_handler (graph, vme, NULL); - return ret; -} - /* builds a graph for nfs server role, with option overrides in mod_dict */ static int build_nfs_graph (glusterfs_graph_t *graph, dict_t *mod_dict) @@ -2041,10 +2036,10 @@ build_nfs_graph (glusterfs_graph_t *graph, dict_t *mod_dict) if (mod_dict) { dict_copy (mod_dict, set_dict); ret = volgen_graph_set_options_generic (&cgraph, set_dict, voliter, - nfs_spec_option_handler); + basic_option_handler); } else { ret = volgen_graph_set_options_generic (&cgraph, voliter->dict, voliter, - nfs_spec_option_handler); + basic_option_handler); } ret = volgen_graph_merge_sub (graph, &cgraph); @@ -2052,7 +2047,24 @@ build_nfs_graph (glusterfs_graph_t *graph, dict_t *mod_dict) goto out; } + list_for_each_entry (voliter, &priv->volumes, vol_list) { + + if (mod_dict) { + dict_copy (mod_dict, set_dict); + ret = volgen_graph_set_options_generic (graph, set_dict, voliter, + nfs_option_handler); + } else { + ret = volgen_graph_set_options_generic (graph, voliter->dict, voliter, + nfs_option_handler); + } + + if (ret) + gf_log ("glusterd", GF_LOG_WARNING, "Could not set " + "vol-options for the volume %s", voliter->volname); + } + out: + gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret); dict_destroy (set_dict); return ret; |