summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorHarshavardhana <harsha@zresearch.com>2009-02-19 04:59:29 -0800
committerAnand V. Avati <avati@amp.gluster.com>2009-02-21 21:14:47 +0530
commita7b514ab8ec879a67e5a290743b4be6f0b58de1d (patch)
tree52054f968eba124059b2ec92d88fe246603f7753 /glusterfsd
parenta2131aeafa94d671b0121631922d823c8a7ab988 (diff)
command line and mount/fuse now use float attr/entry timeouts
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 545f40e..809a4ff 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -230,10 +230,10 @@ _add_fuse_mount (xlator_t *graph)
}
if (cmd_args->fuse_attribute_timeout)
- ret = dict_set_uint32 (top->options, ZR_ATTR_TIMEOUT_OPT,
+ ret = dict_set_double (top->options, ZR_ATTR_TIMEOUT_OPT,
cmd_args->fuse_attribute_timeout);
if (cmd_args->fuse_entry_timeout)
- ret = dict_set_uint32 (top->options, ZR_ENTRY_TIMEOUT_OPT,
+ ret = dict_set_double (top->options, ZR_ENTRY_TIMEOUT_OPT,
cmd_args->fuse_entry_timeout);
#ifdef GF_DARWIN_HOST_OS
@@ -641,7 +641,8 @@ parse_opts (int key, char *arg, struct argp_state *state)
{
cmd_args_t *cmd_args = NULL;
uint32_t n = 0;
-
+ double d = 0.0;
+
cmd_args = state->input;
switch (key) {
@@ -731,10 +732,11 @@ parse_opts (int key, char *arg, struct argp_state *state)
break;
case ARGP_ENTRY_TIMEOUT_KEY:
- n = 0;
+ d = 0.0;
- if (gf_string2uint_base10 (arg, &n) == 0) {
- cmd_args->fuse_entry_timeout = n;
+ gf_string2double (arg, &d);
+ if (!(d < 0.0)) {
+ cmd_args->fuse_entry_timeout = d;
break;
}
@@ -742,10 +744,11 @@ parse_opts (int key, char *arg, struct argp_state *state)
break;
case ARGP_ATTRIBUTE_TIMEOUT_KEY:
- n = 0;
-
- if (gf_string2uint_base10 (arg, &n) == 0) {
- cmd_args->fuse_attribute_timeout = n;
+ d = 0.0;
+
+ gf_string2double (arg, &d);
+ if (!(d < 0.0)) {
+ cmd_args->fuse_attribute_timeout = d;
break;
}