summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/utils/mount.glusterfs.in
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mount/fuse/utils/mount.glusterfs.in')
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in84
1 files changed, 69 insertions, 15 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 959f2272e2f..ac4d94cb743 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
@@ -189,7 +185,16 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --thin-client");
fi
-#options with values start here
+ if [ -n "$global_threading" ]; then
+ cmd_line=$(echo "$cmd_line --global-threading");
+ fi
+
+#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");
@@ -229,6 +234,10 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --reader-thread-count=$reader_thread_count");
fi
+ if [ -n "$fuse_auto_invalidation" ]; then
+ cmd_line=$(echo "$cmd_line --auto-invalidation=$fuse_auto_invalidation");
+ fi
+
if [ -n "$volume_name" ]; then
cmd_line=$(echo "$cmd_line --volume-name=$volume_name");
fi
@@ -249,6 +258,14 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --gid-timeout=$gid_timeout");
fi
+ if [ -n "$lru_limit" ]; then
+ cmd_line=$(echo "$cmd_line --lru-limit=$lru_limit");
+ fi
+
+ if [ -n "$invalidate_limit" ]; then
+ cmd_line=$(echo "$cmd_line --invalidate-limit=$invalidate_limit");
+ fi
+
if [ -n "$bg_qlen" ]; then
cmd_line=$(echo "$cmd_line --background-qlen=$bg_qlen");
fi
@@ -281,6 +298,10 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --dump-fuse=$dump_fuse");
fi
+ if [ -n "$fuse_flush_handle_interrupt" ]; then
+ cmd_line=$(echo "$cmd_line --fuse-flush-handle-interrupt=$fuse_flush_handle_interrupt");
+ fi
+
if [ -n "$process_name" ]; then
cmd_line=$(echo "$cmd_line --process-name fuse.$process_name");
else
@@ -346,10 +367,17 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --subdir-mount=/$subdir_mount");
fi
+ if [ -n "$fuse_dev_eperm_ratelimit_ns" ]; then
+ cmd_line=$(echo "$cmd_line --fuse-dev-eperm-ratelimit-ns=$fuse_dev_eperm_ratelimit_ns");
+ fi
+
cmd_line=$(echo "$cmd_line $mount_point");
$cmd_line;
if [ $? -ne 0 ]; then
- warn "Mount failed. Please check the log file for more details."
+ # If this is true, then glusterfs process returned error without
+ # getting daemonized. We have made sure the logs are posted to
+ # 'stderr', so no need to point them to logfile.
+ warn "Mounting glusterfs on $mount_point failed."
exit 1;
fi
@@ -357,7 +385,9 @@ start_glusterfs ()
inode=$( ${getinode} $mount_point 2>/dev/null);
# this is required if the stat returns error
if [ $? -ne 0 ]; then
- warn "Mount failed. Please check the log file for more details."
+ # At this time, glusterfs got daemonized, and then later exited.
+ # These failures are only logged in log file.
+ warn "Mount failed. Check the log file ${log_file} for more details."
umount $mount_point > /dev/null 2>&1;
exit 1;
fi
@@ -366,9 +396,9 @@ start_glusterfs ()
print_usage ()
{
cat << EOF
-Usage: $0 <volumeserver>:<volumeid/volumeport> -o<options> <mountpoint>
+Usage: $0 <server>:<volume/subdir> <mountpoint> -o<options>
Options:
-man 8 $0
+man 8 $(basename $0)
To display the version number of the mount helper: $0 -V
EOF
}
@@ -485,6 +515,12 @@ with_options()
"gid-timeout")
gid_timeout=$value
;;
+ "lru-limit")
+ lru_limit=$value
+ ;;
+ "invalidate-limit")
+ invalidate_limit=$value
+ ;;
"background-qlen")
bg_qlen=$value
;;
@@ -518,6 +554,9 @@ with_options()
"reader-thread-count")
reader_thread_count=$value
;;
+ "auto-invalidation")
+ fuse_auto_invalidation=$value
+ ;;
"no-root-squash")
if [ $value = "yes" ] ||
[ $value = "on" ] ||
@@ -541,6 +580,12 @@ with_options()
"dump-fuse")
dump_fuse=$value
;;
+ "fuse-flush-handle-interrupt")
+ fuse_flush_handle_interrupt=$value
+ ;;
+ "fuse-dev-eperm-ratelimit-ns")
+ fuse_dev_eperm_ratelimit_ns=$value
+ ;;
"context"|"fscontext"|"defcontext"|"rootcontext")
# standard SElinux mount options to pass to the kernel
[ -z "$fuse_mountopts" ] || fuse_mountopts="$fuse_mountopts,"
@@ -558,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
;;
@@ -585,9 +634,6 @@ without_options()
"worm")
worm=1
;;
- "fopen-keep-cache")
- fopen_keep_cache=1
- ;;
"enable-ino32")
enable_ino32=1
;;
@@ -608,6 +654,9 @@ without_options()
# "mount -t glusterfs" sends this, but it's useless.
"rw")
;;
+ "global-threading")
+ global_threading=1
+ ;;
# TODO: not sure how to handle this yet
"async"|"sync"|"dirsync"|\
"mand"|"nomand"|\
@@ -629,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
;;
@@ -670,7 +723,7 @@ update_updatedb()
main ()
{
- if [ "x${uname_s}" = "xLinux" ] ; then
+ if [ "x${uname_s}" = "xLinux" -a $# -ge 2 ] ; then
volfile_loc=$1
mount_point=$2
@@ -710,7 +763,7 @@ main ()
[ -r "$volfile_loc" ] || {
# '%' included to support ipv6 link local addresses
- server_ip=$(echo "$volfile_loc" | sed -n 's/\([a-zA-Z0-9:%.\-]*\):.*/\1/p');
+ server_ip=$(echo "$volfile_loc" | sed -n 's/\([a-zA-Z0-9:%,.\-]*\):.*/\1/p');
volume_str=$(echo "$volfile_loc" | sed -n 's/.*:\([^ ]*\).*/\1/p');
[ -n "$volume_str" ] && {
volume_id=$volume_str
@@ -723,6 +776,7 @@ main ()
[ $(echo $volume_str_temp | grep -c "/") -eq 1 ] &&
[ "$volume_id_temp" != "snaps" ] && {
volume_id=$volume_id_temp;
+ [ ${first_char} = '/' ] && volume_id=/$volume_id;
subdir_mount=$(echo "$volume_str_temp" | cut -f2- -d '/');
}
}
@@ -762,7 +816,7 @@ EOF
}
# Simple check to avoid multiple identical mounts
- if grep -q "[[:space:]+]${mount_point}[[:space:]+]fuse" $mounttab; then
+ if grep -q "[[:space:]+]${mount_point}[[:space:]+]fuse.glusterfs" $mounttab; then
warn "$0: according to mtab, GlusterFS is already mounted on" \
"$mount_point"
exit 32;