summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 2b6ee545..5d558662 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -178,6 +178,8 @@ static struct argp_option gf_options[] = {
"\"on\" for fds not opened with O_RDONLY]"},
{"entry-timeout", ARGP_ENTRY_TIMEOUT_KEY, "SECONDS", 0,
"Set entry timeout to SECONDS in fuse kernel module [default: 1]"},
+ {"negative-timeout", ARGP_NEGATIVE_TIMEOUT_KEY, "SECONDS", 0,
+ "Set negative timeout to SECONDS in fuse kernel module [default: 0]"},
{"attribute-timeout", ARGP_ATTRIBUTE_TIMEOUT_KEY, "SECONDS", 0,
"Set attribute timeout to SECONDS for inodes in fuse kernel module "
"[default: 1]"},
@@ -302,6 +304,17 @@ create_fuse_mount (glusterfs_ctx_t *ctx)
}
}
+ if (cmd_args->fuse_negative_timeout >= 0) {
+ ret = dict_set_double (master->options, ZR_NEGATIVE_TIMEOUT_OPT,
+ cmd_args->fuse_negative_timeout);
+ if (ret < 0) {
+ gf_log ("glusterfsd", GF_LOG_ERROR,
+ "failed to set dict value for key %s",
+ ZR_NEGATIVE_TIMEOUT_OPT);
+ goto err;
+ }
+ }
+
if (cmd_args->client_pid_set) {
ret = dict_set_int32 (master->options, "client-pid",
cmd_args->client_pid);
@@ -746,6 +759,18 @@ parse_opts (int key, char *arg, struct argp_state *state)
argp_failure (state, -1, 0, "unknown entry timeout %s", arg);
break;
+ case ARGP_NEGATIVE_TIMEOUT_KEY:
+ d = 0.0;
+
+ gf_string2double (arg, &d);
+ if (!(d < 0.0)) {
+ cmd_args->fuse_negative_timeout = d;
+ break;
+ }
+
+ argp_failure (state, -1, 0, "unknown negative timeout %s", arg);
+ break;
+
case ARGP_ATTRIBUTE_TIMEOUT_KEY:
d = 0.0;