diff options
Diffstat (limited to 'glusterfsd')
| -rw-r--r-- | glusterfsd/src/glusterfsd.c | 25 | ||||
| -rw-r--r-- | glusterfsd/src/glusterfsd.h | 1 | 
2 files changed, 26 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 2b6ee5452..5d5586625 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; diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h index 75edff6a6..4f08cd31a 100644 --- a/glusterfsd/src/glusterfsd.h +++ b/glusterfsd/src/glusterfsd.h @@ -63,6 +63,7 @@ enum argp_option_keys {          ARGP_NO_DAEMON_KEY                = 'N',          ARGP_RUN_ID_KEY                   = 'r',          ARGP_DEBUG_KEY                    = 133, +        ARGP_NEGATIVE_TIMEOUT_KEY         = 134,          ARGP_ENTRY_TIMEOUT_KEY            = 135,          ARGP_ATTRIBUTE_TIMEOUT_KEY        = 136,          ARGP_VOLUME_NAME_KEY              = 137,  | 
