diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2013-07-11 12:52:11 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-07-12 07:36:05 -0700 |
commit | 61b09562b934b53dadcd566f6feb72301097933c (patch) | |
tree | 8087a81113e94f00f29eb0cac545eddfbad5bf5f /glusterfsd | |
parent | 07833f13d43a3e3532171bb2edbe068e3a7205b1 (diff) |
mount/fuse: Provide option to use/not use kernel-readdirp
By default fuse kernel readdirp usage in fuse xlator is off.
When mount option use-readdirp=yes is provided it starts using
fuse-kernel's readdirp.
Change-Id: Id37edc53b1adc1638186d956c2f74c1e4e48aa59
BUG: 983477
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5322
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'glusterfsd')
-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 1c746d9c44a..213b589a5be 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 5b5805d14f4..be91ce54866 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 { |