diff options
author | Harshavardhana <harsha@zresearch.com> | 2009-02-19 04:59:29 -0800 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-02-21 21:14:47 +0530 |
commit | a7b514ab8ec879a67e5a290743b4be6f0b58de1d (patch) | |
tree | 52054f968eba124059b2ec92d88fe246603f7753 | |
parent | a2131aeafa94d671b0121631922d823c8a7ab988 (diff) |
command line and mount/fuse now use float attr/entry timeouts
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r-- | doc/translator-options.txt | 4 | ||||
-rw-r--r-- | glusterfsd/src/glusterfsd.c | 23 | ||||
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 20 |
3 files changed, 23 insertions, 24 deletions
diff --git a/doc/translator-options.txt b/doc/translator-options.txt index 3d8402be5fc..38b04b5fc21 100644 --- a/doc/translator-options.txt +++ b/doc/translator-options.txt @@ -2,8 +2,8 @@ mount/fuse: * direct-io-mode GF_OPTION_TYPE_BOOL on|off|yes|no * macfuse-local GF_OPTION_TYPE_BOOL on|off|yes|no * mount-point (mountpoint) GF_OPTION_TYPE_PATH <any-posix-valid-path> - * attribute-timeout GF_OPTION_TYPE_TIME 0-3600 - * entry-timeout GF_OPTION_TYPE_TIME 0-3600 + * attribute-timeout GF_OPTION_TYPE_DOUBLE 0.0 + * entry-timeout GF_OPTION_TYPE_DOUBLE 0.0 protocol/server: * transport-type GF_OPTION_TYPE_STR tcp|socket|ib-verbs|unix|ib-sdp| diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 545f40e80f8..809a4ffa9c7 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; } diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 8e70558782d..43d3af76ac5 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -70,8 +70,8 @@ struct fuse_private { pthread_t fuse_thread; char fuse_thread_started; uint32_t direct_io_mode; - uint32_t entry_timeout; - uint32_t attribute_timeout; + double entry_timeout; + double attribute_timeout; }; typedef struct fuse_private fuse_private_t; @@ -2720,15 +2720,15 @@ init (xlator_t *this_xl) priv->mount_point = strdup (value_string); - ret = dict_get_uint32 (options, "attribute-timeout", + ret = dict_get_double (options, "attribute-timeout", &priv->attribute_timeout); if (!priv->attribute_timeout) - priv->attribute_timeout = 1; /* default */ + priv->attribute_timeout = 1.0; /* default */ - ret = dict_get_uint32 (options, "entry-timeout", + ret = dict_get_double (options, "entry-timeout", &priv->entry_timeout); if (!priv->entry_timeout) - priv->entry_timeout = 1; /* default */ + priv->entry_timeout = 1.0; /* default */ priv->direct_io_mode = 1; @@ -2846,14 +2846,10 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_PATH }, { .key = {"attribute-timeout"}, - .type = GF_OPTION_TYPE_TIME, - .min = 0, - .max = 3600 + .type = GF_OPTION_TYPE_DOUBLE }, { .key = {"entry-timeout"}, - .type = GF_OPTION_TYPE_TIME, - .min = 0, - .max = 3600 + .type = GF_OPTION_TYPE_DOUBLE }, { .key = {NULL} }, }; |