diff options
Diffstat (limited to 'glusterfsd/src')
-rw-r--r-- | glusterfsd/src/glusterfsd.c | 32 | ||||
-rw-r--r-- | glusterfsd/src/glusterfsd.h | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 28de24e8da6..6dabd6a48e3 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -198,6 +198,9 @@ static struct argp_option gf_options[] = { "Enable internal memory accounting"}, {"fuse-mountopts", ARGP_FUSE_MOUNTOPTS_KEY, "OPTIONS", OPTION_HIDDEN, "Extra mount options to pass to FUSE"}, + {"use-readdirp", ARGP_FUSE_USE_READDIRP_KEY, "BOOL", OPTION_ARG_OPTIONAL, + "Use readdirp mode in fuse kernel module" + " [default: \"off\"]"}, {0, 0, 0, 0, "Miscellaneous Options:"}, {0, } }; @@ -440,6 +443,16 @@ set_fuse_mount_options (glusterfs_ctx_t *ctx, dict_t *options) goto err; } } + + if (cmd_args->use_readdirp) { + ret = dict_set_str (options, "use-readdirp", + cmd_args->use_readdirp); + if (ret < 0) { + gf_log ("glusterfsd", GF_LOG_ERROR, "failed to set dict" + " value for key use-readdirp"); + goto err; + } + } ret = 0; err: return ret; @@ -949,6 +962,25 @@ parse_opts (int key, char *arg, struct argp_state *state) case ARGP_FUSE_MOUNTOPTS_KEY: cmd_args->fuse_mountopts = gf_strdup (arg); break; + + case ARGP_FUSE_USE_READDIRP_KEY: + if (!arg) + arg = "no"; + + if (gf_string2boolean (arg, &b) == 0) { + if (b) { + cmd_args->use_readdirp = "yes"; + } else { + cmd_args->use_readdirp = "no"; + } + + break; + } + + argp_failure (state, -1, 0, + "unknown use-readdirp setting \"%s\"", arg); + break; + } return 0; diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h index ff3998a4a29..8fb089c87e1 100644 --- a/glusterfsd/src/glusterfsd.h +++ b/glusterfsd/src/glusterfsd.h @@ -84,6 +84,7 @@ enum argp_option_keys { ARGP_FUSE_CONGESTION_THRESHOLD_KEY = 162, ARGP_INODE32_KEY = 163, ARGP_FUSE_MOUNTOPTS_KEY = 164, + ARGP_FUSE_USE_READDIRP_KEY = 165, }; struct _gfd_vol_top_priv_t { |