diff options
author | Kaushal M <kaushal@redhat.com> | 2012-04-02 13:00:47 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-02 02:41:18 -0700 |
commit | e51f690d7c5eda400316ba97ab2f4ce448b51e7d (patch) | |
tree | d02b569563fb8a171b621f8c7a9e0eccc5e67557 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 0f3b55be4376c1c59131d999469d3b3c6aaddd87 (diff) |
glusterd: Include port in nfs status
Change-Id: I679e491e801b694e8a0f93dd87cf540441dae927
BUG: 806877
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3060
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index fc5a83e4564..37899d4be46 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2958,13 +2958,15 @@ glusterd_shd_stop () } int -glusterd_add_node_to_dict (char *server, dict_t *dict, int count) +glusterd_add_node_to_dict (char *server, dict_t *dict, int count, + dict_t *vol_opts) { int ret = -1; glusterd_conf_t *priv = THIS->private; char pidfile[PATH_MAX] = {0,}; gf_boolean_t running = _gf_false; int pid = -1; + int port = 0; char key[1024] = {0,}; glusterd_get_nodesvc_pidfile (server, priv->workdir, pidfile, @@ -2996,7 +2998,19 @@ glusterd_add_node_to_dict (char *server, dict_t *dict, int count) memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "brick%d.port", count); - ret = dict_set_int32 (dict, key, 0); + /* Port is available only for the NFS server. + * Self-heal daemon doesn't provide any port for access + * by entities other than gluster. + */ + if (!strcmp (server, "nfs")) { + if (dict_get (vol_opts, "nfs.port")) { + ret = dict_get_int32 (vol_opts, "nfs.port", &port); + if (ret) + goto out; + } else + port = GF_NFS3_PORT; + } + ret = dict_set_int32 (dict, key, port); if (ret) goto out; |