summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2012-07-18 15:50:35 -0700
committerAnand Avati <avati@redhat.com>2012-07-19 09:05:30 -0700
commit7018d7178e366146881d693e0159e13307e888ee (patch)
tree811ae5e3eb754bba1c6a30d37fa0ee3e87141a99 /glusterfsd/src/glusterfsd.c
parent00bd49b6c97b6b81fa55be3dc49459080d7c3b1b (diff)
fuse-bridge: expose negative entry caching of FUSE
Fuse kernel module supports caching negative entries, enabled by specifying a timeout while returning ENOENT to lookup. This patch enables the functionality to be enabled with the command line. Also fixed a typo bug in mount.glusterfs.in. Change-Id: I47eab2834cca9a05887266358afbf504bbb4c489 BUG: 841417 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3696 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
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 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;