diff options
author | Philip Spencer <pspencer@fields.utoronto.ca> | 2019-05-07 10:19:34 -0400 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-08-16 05:35:02 +0000 |
commit | a24288c5c9da9137eb1d5d487bc7cd11af01b88b (patch) | |
tree | 5f3c417cfae804ca01037924b12d7456da8dff8d | |
parent | 8e9c53ebf16705b9a1db2fc486dc24a5cb244ddd (diff) |
mount.glusterfs: make fcache-keep-open option take a value
Fixes: bz#1158130
Change-Id: Ifdeaed7c9fbe85f7ce421f7c89cbe7265e45f77c
Signed-off-by: Amar Tumballi <amarts@redhat.com>
-rw-r--r-- | doc/glusterfs.8 | 4 | ||||
-rw-r--r-- | doc/mount.glusterfs.8 | 4 | ||||
-rw-r--r-- | glusterfsd/src/glusterfsd.c | 2 | ||||
-rwxr-xr-x | 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 ;; |