From ae084046cce12a1ce707b5d141f092b4c011e1b3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 19 Jul 2017 23:08:05 +0530 Subject: 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 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 Reviewed-on: https://review.gluster.org/17968 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- glusterfsd/src/glusterfsd.c | 10 ++++++++++ glusterfsd/src/glusterfsd.h | 1 + 2 files changed, 11 insertions(+) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index ebf58706107..78b06bf4701 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -160,6 +160,8 @@ static struct argp_option gf_options[] = { "Enable SELinux label (extended attributes) support on inodes"}, {"capability", ARGP_CAPABILITY_KEY, 0, 0, "Enable Capability (extended attributes) support on inodes"}, + {"subdir-mount", ARGP_SUBDIR_MOUNT_KEY, "SUBDIR-PATH", 0, + "Mount subdirectory given [default: NULL]"}, {"print-netgroups", ARGP_PRINT_NETGROUPS, "NETGROUP-FILE", 0, "Validate the netgroups file and print it out"}, @@ -1277,6 +1279,14 @@ no_oom_api: case ARGP_LOCALTIME_LOGGING_KEY: cmd_args->localtime_logging = 1; break; + case ARGP_SUBDIR_MOUNT_KEY: + if (arg[0] != '/') { + argp_failure (state, -1, 0, + "expect '/%s', provided just \"%s\"", arg, arg); + break; + } + cmd_args->subdir_mount = gf_strdup (arg); + break; } return 0; diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h index c1d5dc08405..871bcf61e58 100644 --- a/glusterfsd/src/glusterfsd.h +++ b/glusterfsd/src/glusterfsd.h @@ -97,6 +97,7 @@ enum argp_option_keys { ARGP_OOM_SCORE_ADJ_KEY = 176, #endif ARGP_LOCALTIME_LOGGING_KEY = 177, + ARGP_SUBDIR_MOUNT_KEY = 178, }; struct _gfd_vol_top_priv { -- cgit