From a24288c5c9da9137eb1d5d487bc7cd11af01b88b Mon Sep 17 00:00:00 2001 From: Philip Spencer Date: Tue, 7 May 2019 10:19:34 -0400 Subject: mount.glusterfs: make fcache-keep-open option take a value Fixes: bz#1158130 Change-Id: Ifdeaed7c9fbe85f7ce421f7c89cbe7265e45f77c Signed-off-by: Amar Tumballi --- doc/glusterfs.8 | 4 ++-- doc/mount.glusterfs.8 | 4 ++-- glusterfsd/src/glusterfsd.c | 2 +- xlators/mount/fuse/utils/mount.glusterfs.in | 22 ++++++++++++++-------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/doc/glusterfs.8 b/doc/glusterfs.8 index e36bd6fbcfe..3d359ea85e4 100644 --- a/doc/glusterfs.8 +++ b/doc/glusterfs.8 @@ -63,8 +63,8 @@ and \fB\-\-log\-file\fR to console. \fB\-\-enable\-ino32=BOOL\fR Use 32-bit inodes when mounting to workaround application that doesn't support 64-bit inodes. .TP -\fB\-\-fopen\-keep\-cache\fR -Do not purge the cache on file open. +\fB\-\-fopen\-keep\-cache[=BOOL]\fR +Do not purge the cache on file open (default: false). .TP \fB\-\-mac\-compat=BOOL\fR Provide stubs for attributes needed for seamless operation on Macs (the default is off). diff --git a/doc/mount.glusterfs.8 b/doc/mount.glusterfs.8 index b35b362d69a..a17f1802a37 100644 --- a/doc/mount.glusterfs.8 +++ b/doc/mount.glusterfs.8 @@ -44,8 +44,8 @@ INFO and NONE [default: INFO] \fBacl Mount the filesystem with POSIX ACL support .TP -\fBfopen\-keep\-cache -Do not purge the cache on file open +\fBfopen\-keep\-cache[=BOOL] +Do not purge the cache on file open (default: false) .TP \fBworm Mount the filesystem in 'worm' mode diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index b2fc944b92a..65011cd43ef 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -198,7 +198,7 @@ static struct argp_option gf_options[] = { {"brick-port", ARGP_BRICK_PORT_KEY, "BRICK-PORT", OPTION_HIDDEN, "Brick Port to be registered with Gluster portmapper"}, {"fopen-keep-cache", ARGP_FOPEN_KEEP_CACHE_KEY, "BOOL", OPTION_ARG_OPTIONAL, - "Do not purge the cache on file open"}, + "Do not purge the cache on file open [default: false]"}, {"global-timer-wheel", ARGP_GLOBAL_TIMER_WHEEL, "BOOL", OPTION_ARG_OPTIONAL, "Instantiate process global timer-wheel"}, {"thin-client", ARGP_THIN_CLIENT_KEY, 0, 0, diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 59762169f46..99513b4e8c3 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -161,10 +161,6 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --volfile-max-fetch-attempts=$volfile_max_fetch_attempts") fi - if [ -n "$fopen_keep_cache" ]; then - cmd_line=$(echo "$cmd_line --fopen-keep-cache"); - fi - if [ -n "$volfile_check" ]; then cmd_line=$(echo "$cmd_line --volfile-check"); fi @@ -193,7 +189,12 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --global-threading"); fi -#options with values start here +#options with optional values start here + if [ -n "$fopen_keep_cache" ]; then + cmd_line=$(echo "$cmd_line --fopen-keep-cache=$fopen_keep_cache"); + fi + +#options with mandatory values start here if [ -n "$halo_max_latency" ]; then cmd_line=$(echo "$cmd_line --xlator-option \ *replicate*.halo-max-latency=$halo_max_latency"); @@ -602,6 +603,10 @@ with_options() "process-name") process_name=$value ;; + # Values that are optional + "fopen-keep-cache") + fopen_keep_cache="=$value" + ;; x-*) # comments or userspace application-specific options, drop them ;; @@ -629,9 +634,6 @@ without_options() "worm") worm=1 ;; - "fopen-keep-cache") - fopen_keep_cache=1 - ;; "enable-ino32") enable_ino32=1 ;; @@ -676,6 +678,10 @@ without_options() ;; "_netdev") ;; + # Values that are optional + "fopen-keep-cache") + fopen_keep_cache="true" + ;; x-*) # comments or userspace application-specific options, drop them ;; -- cgit