summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c11
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.h1
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in16
3 files changed, 24 insertions, 4 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 726e500e9e4..f9d3846207c 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -4655,6 +4655,8 @@ init (xlator_t *this_xl)
GF_OPTION_INIT("gid-timeout", priv->gid_cache_timeout, int32,
cleanup_exit);
+ GF_OPTION_INIT ("fuse-mountopts", priv->fuse_mountopts, str, cleanup_exit);
+
if (gid_cache_init(&priv->gid_cache, priv->gid_cache_timeout) < 0) {
gf_log("glusterfs-fuse", GF_LOG_ERROR, "Failed to initialize "
"group cache.");
@@ -4716,9 +4718,11 @@ init (xlator_t *this_xl)
goto cleanup_exit;
}
- gf_asprintf (&mnt_args, "%s%sallow_other,max_read=131072",
+ gf_asprintf (&mnt_args, "%s%s%s%sallow_other,max_read=131072",
priv->read_only ? "ro," : "",
- priv->acl ? "" : "default_permissions,");
+ priv->acl ? "" : "default_permissions,",
+ priv->fuse_mountopts ? priv->fuse_mountopts : "",
+ priv->fuse_mountopts ? "," : "");
if (!mnt_args)
goto cleanup_exit;
@@ -4886,5 +4890,8 @@ struct volume_options options[] = {
.min = 12,
.max = (64 * GF_UNIT_KB),
},
+ { .key = {"fuse-mountopts"},
+ .type = GF_OPTION_TYPE_STR
+ },
{ .key = {NULL} },
};
diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h
index 3f45f064463..7db9d653c25 100644
--- a/xlators/mount/fuse/src/fuse-bridge.h
+++ b/xlators/mount/fuse/src/fuse-bridge.h
@@ -107,6 +107,7 @@ struct fuse_private {
gf_boolean_t enable_ino32;
fdtable_t *fdtable;
gid_cache_t gid_cache;
+ char *fuse_mountopts;
/* For fuse-reverse-validation */
int revchan_in;
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 9b9c0f81b6f..0d92bfbd595 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -156,6 +156,10 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --congestion-threshold=$cong_threshold");
fi
+ if [ -n "$fuse_mountopts" ]; then
+ cmd_line=$(echo "$cmd_line --fuse-mountopts=$fuse_mountopts");
+ fi
+
# for rdma volume, we have to fetch volfile with '.rdma' added
# to volume name, so that it fetches the right client vol file
volume_id_rdma="";
@@ -190,6 +194,10 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --volfile=$volfile_loc");
fi
+ if [ -n "$fuse_mountopts" ]; then
+ cmd_line=$(echo "$cmd_line --fuse-mountopts=$fuse_mountopts");
+ fi
+
cmd_line=$(echo "$cmd_line $mount_point");
err=0;
$cmd_line;
@@ -353,7 +361,12 @@ main ()
"gid-timeout") gid_timeout=$value ;;
"background-qlen") bg_qlen=$value ;;
"congestion-threshold") cong_threshold=$value ;;
- *) echo "unknown option $key (ignored)" ;;
+ "fuse-mountopts") fuse_mountopts=$value ;;
+ *)
+ # Passthru
+ [ -z "$fuse_mountopts" ] || fuse_mountopts="$fuse_mountopts,"
+ fuse_mountopts="$fuse_mountopts$pair"
+ ;;
esac
esac
done
@@ -422,4 +435,3 @@ main ()
}
_init "$@" && main "$@";
-