From 68944b104952751b5bd551fe1d84a6bb20962484 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Tue, 5 Sep 2017 23:58:15 -0400 Subject: mount/fuse: Include sub-directory in source argument for mount() With this, mount of a sub-directory 'foo' gets listed in /proc/mounts as: :/foo on /mnt/glusterfs type fuse.glusterfs (rw,relatime...) Signed-off-by: Vijay Bellur BUG: 1490493 Change-Id: Ib1e1ac3741bf66e1a912d792f2948b748931f2b0 Reviewed-on: https://review.gluster.org/18210 CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos Smoke: Gluster Build System Reviewed-by: Amar Tumballi (cherry picked from commit 84f8fb81d73b87463092eb082a5cc6a4055103f4) --- xlators/mount/fuse/src/fuse-bridge.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index f9df3586c44..4865ffdc562 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -5684,9 +5684,13 @@ init (xlator_t *this_xl) fsname = cmd_args->volfile; if (!fsname && cmd_args->volfile_server) { if (cmd_args->volfile_id) { + int dir_len = 0; + if (cmd_args->subdir_mount) + dir_len = strlen (cmd_args->subdir_mount) + 1; fsname = GF_MALLOC ( strlen (cmd_args->volfile_server) + 1 + - strlen (cmd_args->volfile_id) + 1, + strlen (cmd_args->volfile_id) + 1 + + dir_len, gf_fuse_mt_fuse_private_t); if (!fsname) { gf_log ("glusterfs-fuse", GF_LOG_ERROR, @@ -5697,6 +5701,8 @@ init (xlator_t *this_xl) strcpy (fsname, cmd_args->volfile_server); strcat (fsname, ":"); strcat (fsname, cmd_args->volfile_id); + if (dir_len) + strcat (fsname, cmd_args->subdir_mount); } else fsname = cmd_args->volfile_server; } -- cgit