summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2017-10-10 14:45:03 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-10-18 14:15:05 +0000
commit77271e9c1efab628d00bc66803be923f451c0bfa (patch)
tree4e4183568a2fdda702ae5cdcd4624a53fc39b1cf /glusterfsd
parente848410ab6d13871be6b57101788ea5183efe75c (diff)
gfproxyd: Let glusterd manage gfproxy daemon
Updates: #242 BUG: 1428063 Change-Id: Iaaf2edf99b2ecc75f6d30762c752a6d445c1c826 Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c27
-rw-r--r--glusterfsd/src/glusterfsd.h1
2 files changed, 27 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 3f56cd0ce35..2a1898be30e 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -192,6 +192,8 @@ static struct argp_option gf_options[] = {
"Do not purge the cache on file open"},
{"global-timer-wheel", ARGP_GLOBAL_TIMER_WHEEL, "BOOL",
OPTION_ARG_OPTIONAL, "Instantiate process global timer-wheel"},
+ {"thin-client", ARGP_THIN_CLIENT_KEY, 0, 0,
+ "Enables thin mount and connects via gfproxyd daemon"},
{0, 0, 0, 0, "Fuse options:"},
{"direct-io-mode", ARGP_DIRECT_IO_MODE_KEY, "BOOL", OPTION_ARG_OPTIONAL,
@@ -566,6 +568,15 @@ set_fuse_mount_options (glusterfs_ctx_t *ctx, dict_t *options)
goto err;
}
}
+ if (cmd_args->thin_client) {
+ ret = dict_set_static_ptr (options, "thin-client", "on");
+ if (ret < 0) {
+ gf_msg ("glusterfsd", GF_LOG_ERROR, 0, glusterfsd_msg_4,
+ "thin-client");
+ goto err;
+ }
+ }
+
ret = 0;
err:
return ret;
@@ -978,6 +989,10 @@ parse_opts (int key, char *arg, struct argp_state *state)
cmd_args->volfile_id = gf_strdup (arg);
break;
+ case ARGP_THIN_CLIENT_KEY:
+ cmd_args->thin_client = _gf_true;
+ break;
+
case ARGP_PID_FILE_KEY:
cmd_args->pid_file = gf_strdup (arg);
break;
@@ -1320,7 +1335,6 @@ no_oom_api:
"unknown event-history setting \"%s\"", arg);
break;
}
-
return 0;
}
@@ -1923,6 +1937,8 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
char *tmp_logfile_dyn = NULL;
char *tmp_logfilebase = NULL;
cmd_args_t *cmd_args = NULL;
+ int len = 0;
+ char *thin_volfileid = NULL;
cmd_args = &ctx->cmd_args;
@@ -1993,6 +2009,15 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
}
}
+ if (cmd_args->thin_client) {
+ len = strlen (cmd_args->volfile_id) + strlen ("gfproxy-client/");
+ thin_volfileid = GF_CALLOC (1, len + 1, gf_common_mt_char);
+ snprintf (thin_volfileid, len + 1, "gfproxy-client/%s",
+ cmd_args->volfile_id);
+ GF_FREE (cmd_args->volfile_id);
+ cmd_args->volfile_id = thin_volfileid;
+ }
+
if (cmd_args->run_id) {
ret = sys_lstat (cmd_args->log_file, &stbuf);
/* If its /dev/null, or /dev/stdout, /dev/stderr,
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index 058a43fd385..9a0281e78a4 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -100,6 +100,7 @@ enum argp_option_keys {
ARGP_SUBDIR_MOUNT_KEY = 178,
ARGP_PROCESS_NAME_KEY = 179,
ARGP_FUSE_EVENT_HISTORY_KEY = 180,
+ ARGP_THIN_CLIENT_KEY = 181,
};
struct _gfd_vol_top_priv {