diff options
Diffstat (limited to 'xlators/mount/fuse/utils')
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 66dd7cd960f..826991ba402 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -312,6 +312,10 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --fuse-mountopts=$fuse_mountopts"); fi + if [ -n "$subdir_mount" ]; then + cmd_line=$(echo "$cmd_line --subdir-mount=/$subdir_mount"); + fi + cmd_line=$(echo "$cmd_line $mount_point"); $cmd_line; if [ $? -ne 0 ]; then @@ -430,6 +434,9 @@ with_options() "volume-id") volume_id=$value ;; + "subdir-mount") + subdir_mount=$value + ;; "volfile-check") volfile_check=$value ;; @@ -655,7 +662,15 @@ main () 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"; + volume_id=$volume_str + volume_str_temp=$volume_str + [ ${volume_str:0:1} = '/' ] && { + volume_str_temp=${volume_str:1} + } + [ $(echo $volume_str_temp | grep -c "/") -eq 1 ] && { + volume_id=$(echo "$volume_str_temp" | cut -f1 -d '/'); + subdir_mount=$(echo "$volume_str_temp" | cut -f2- -d '/'); + } } volfile_loc=""; [ -z "$volume_id" -o -z "$server_ip" ] && { |