From 9f5b8911b484230304fa52c0fcd92f696a4af74a Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 12 Jul 2012 17:35:37 +0530 Subject: glusterd: Refactored brickinfo APIs This patch modifies the existing brickinfo function signatures and/or names to do one thing right and call them by 'appropriate' names. - Decoupled brickinfo_get and is_brickpath_available - Removed dead comment about realpath(3) in canonicalize_path - Renamed glusterd_brickinfo_from_brick to glusterd_brickinfo_new_from_brick to make the name of the function reflect that an allocation is happening Change-Id: I29daba6d431ca799d43c927b9dfbaeda327e83e8 BUG: 764890 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.com/3668 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 26817d4e3cc..d6855b9043b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -654,7 +654,6 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr) xlator_t *this = NULL; glusterd_conf_t *priv = NULL; glusterd_brickinfo_t *brickinfo = NULL; - glusterd_brickinfo_t *tmpbrickinfo = NULL; glusterd_volinfo_t *volinfo = NULL; dict_t *vol_opts = NULL; gf_boolean_t nfs_disabled = _gf_false; @@ -742,21 +741,8 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr) if (ret) goto out; - ret = glusterd_brickinfo_from_brick (brick, &brickinfo); - if (ret) { - snprintf (msg, sizeof (msg), "%s is not a brick", - brick); - gf_log (THIS->name, GF_LOG_ERROR, "%s", msg); - goto out; - } - - ret = glusterd_volume_brickinfo_get (NULL, - brickinfo->hostname, - brickinfo->path, - volinfo, - &tmpbrickinfo, - GF_PATH_COMPLETE); - + ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, + &brickinfo); if (ret) { snprintf (msg, sizeof(msg), "No brick %s in" " volume %s", brick, volname); @@ -1523,8 +1509,7 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, - &brickinfo, - GF_PATH_COMPLETE); + &brickinfo); if (ret) goto out; @@ -3528,8 +3513,7 @@ glusterd_bricks_select_remove_brick (dict_t *dict, char **op_errstr) } ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, - &brickinfo, - GF_PATH_COMPLETE); + &brickinfo); if (ret) goto out; if (glusterd_is_brick_started (brickinfo)) { @@ -3670,8 +3654,7 @@ glusterd_bricks_select_profile_volume (dict_t *dict, char **op_errstr) ret = dict_get_str (dict, "brick", &brick); if (!ret) { ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, - &brickinfo, - GF_PATH_COMPLETE); + &brickinfo); if (ret) goto out; @@ -4007,8 +3990,7 @@ glusterd_bricks_select_status_volume (dict_t *dict, char **op_errstr) } ret = glusterd_volume_brickinfo_get_by_brick (brickname, volinfo, - &brickinfo, - GF_PATH_COMPLETE); + &brickinfo); if (ret) goto out; -- cgit