diff options
Diffstat (limited to 'xlators/protocol')
| -rw-r--r-- | xlators/protocol/client/src/client-handshake.c | 6 | ||||
| -rw-r--r-- | xlators/protocol/server/src/server-handshake.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index b6dc0797dd9..cd71c2c34a2 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -1360,6 +1360,12 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc) goto fail; } + ret = dict_set_str (options, "process-name", this->ctx->cmd_args.process_name); + if (ret < 0) { + gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_DICT_SET_FAILED, + "failed to set process-name in handshake msg"); + } + ret = dict_set_str (options, "client-version", PACKAGE_VERSION); if (ret < 0) { gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED, diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index fa2f61315df..6dc9a38aa71 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -475,6 +475,7 @@ server_setvolume (rpcsvc_request_t *req) glusterfs_ctx_t *ctx = NULL; struct _child_status *tmp = NULL; char *subdir_mount = NULL; + char *client_name = NULL; params = dict_new (); reply = dict_new (); @@ -609,6 +610,10 @@ server_setvolume (rpcsvc_request_t *req) if (ret < 0) { /* Not a problem at all as the key is optional */ } + ret = dict_get_str (params, "process-name", &client_name); + if (ret < 0) { + client_name = "unknown"; + } /*lk_verion :: [1..2^31-1]*/ ret = dict_get_uint32 (params, "clnt-lk-version", &lk_version); @@ -631,6 +636,8 @@ server_setvolume (rpcsvc_request_t *req) goto fail; } + client->client_name = gf_strdup(client_name); + gf_msg_debug (this->name, 0, "Connected to %s", client->client_uid); cancelled = server_cancel_grace_timer (this, client); if (cancelled)//Do gf_client_put on behalf of grace-timer-handler. |
