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 | |
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')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 11 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 18 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.h | 3 |
3 files changed, 25 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index d548b95a8b6..80553b4376d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1450,14 +1450,15 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, vol_opts = volinfo->dict; if ((cmd & GF_CLI_STATUS_NFS) != 0) { - ret = glusterd_add_node_to_dict ("nfs", rsp_dict, 0); + ret = glusterd_add_node_to_dict ("nfs", rsp_dict, 0, vol_opts); if (ret) goto out; other_count++; node_count++; } else if ((cmd & GF_CLI_STATUS_SHD) != 0) { - ret = glusterd_add_node_to_dict ("glustershd", rsp_dict, 0); + ret = glusterd_add_node_to_dict ("glustershd", rsp_dict, 0, + vol_opts); if (ret) goto out; other_count++; @@ -1513,7 +1514,8 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, if (!nfs_disabled) { ret = glusterd_add_node_to_dict ("nfs", rsp_dict, - other_index); + other_index, + vol_opts); if (ret) goto out; other_index++; @@ -1528,7 +1530,8 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, && shd_enabled) { ret = glusterd_add_node_to_dict ("glustershd", rsp_dict, - other_index); + other_index, + vol_opts); if (ret) goto out; other_count++; 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; diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index 9cea974c179..5491c7a0068 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -420,7 +420,8 @@ glusterd_add_bricks_hname_path_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo); 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); char * glusterd_uuid_to_hostname (uuid_t uuid); |