summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAmar Tumballi <amar@del.gluster.com>2009-02-20 18:09:02 -0800
committerAnand V. Avati <avati@amp.gluster.com>2009-02-22 03:37:55 +0530
commitbcd1e26a95ab75f3431be8e71d93eae9b7b6cbf8 (patch)
treef20d0e1857a31305a820d523c642ab681d3581ad /xlators
parent869df6de6429bd556215a2a555883cabaa4dca80 (diff)
default volume file option enhanced in server-protocolg
Noticed that with current codebase, there is no proper method to have a default volume filename to choose in getspec() without printing a *lot* of warning messages. This patch tries to have a proper 'default' behavior. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/protocol/server/src/server-protocol.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c
index a5198c1ed07..3fa39176fff 100644
--- a/xlators/protocol/server/src/server-protocol.c
+++ b/xlators/protocol/server/src/server-protocol.c
@@ -6826,7 +6826,7 @@ mop_getspec (call_frame_t *frame,
&filename);
if (ret == 0) {
gf_log (trans->xl->name, GF_LOG_WARNING,
- "option 'client-volume-specfile' is changed to "
+ "option 'client-volume-filename' is changed to "
"'volume-filename.<key>' which now takes 'key' as an "
"option to choose/fetch different files from server. "
"Refer documentation or contact developers for more "
@@ -6844,12 +6844,17 @@ mop_getspec (call_frame_t *frame,
key, GLUSTERFSD_SPEC_PATH);
}
}
+
if (!filename) {
- filename = GLUSTERFSD_SPEC_PATH;
- if (!key)
- gf_log (trans->xl->name, GF_LOG_WARNING,
- "using default volume file %s",
- GLUSTERFSD_SPEC_PATH);
+ ret = dict_get_str (frame->this->options,
+ "volume-filename.default", &filename);
+ if (ret < 0) {
+ gf_log (trans->xl->name, GF_LOG_DEBUG,
+ "no default volume filename given, "
+ "defaulting to %s", GLUSTERFSD_SPEC_PATH);
+
+ filename = GLUSTERFSD_SPEC_PATH;
+ }
}
{