diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2012-07-12 17:35:37 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-19 09:09:33 -0700 |
commit | 9f5b8911b484230304fa52c0fcd92f696a4af74a (patch) | |
tree | 39c349e2bec47d1078d8452d84125f16928cdff4 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | c0b07bdf5d253cf5620726f149700960e962b8ec (diff) |
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 <kparthas@redhat.com>
Reviewed-on: http://review.gluster.com/3668
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 30 |
1 files changed, 6 insertions, 24 deletions
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; |