summaryrefslogtreecommitdiffstats
path: root/xlators/mount
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2017-07-19 23:08:05 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-08-04 13:34:21 +0000
commitae084046cce12a1ce707b5d141f092b4c011e1b3 (patch)
treea601c88c90053677478bdab6c602e36eb2f1f0bd /xlators/mount
parent9bc0cf820ace2df58fc666f4ff4c7c50973b60a3 (diff)
glusterfsd: allow subdir mount
Changes: 1. Take subdir mount option in client (mount.gluster / glusterfsd) 2. Pass the subdir mount to server-handshake (from client-handshake) 3. Handle subdir-mount dir's lookup in server-first-lookup and handle all fops resolution accordingly with proper gfid of subdir 4. Change the auth/addr module to handle the multiple subdir entries in option, and valid parsing. How to use the feature: `# mount -t glusterfs $hostname:/$volname/$subdir /$mount_point` Or `# mount -t glusterfs $hostname:/$volname -osubdir_mount=$subdir /$mount_point` Option can be set like: `# gluster volume set <volname> auth.allow "/subdir1(192.168.1.*),/(192.168.10.*),/subdir2(192.168.8.*)"` Updates #175 > Reviewed-At: https://review.gluster.org/17141/ Change-Id: I7ea57f76ddbe6c3862cfe02e13f89e8a39719e11 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: https://review.gluster.org/17968 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/mount')
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in17
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" ] && {