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-log-ops.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-log-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-log-ops.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-log-ops.c b/xlators/mgmt/glusterd/src/glusterd-log-ops.c index 3ac78a917f2..b5fd5eff648 100644 --- a/xlators/mgmt/glusterd/src/glusterd-log-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-log-ops.c @@ -141,16 +141,13 @@ glusterd_op_stage_log_rotate (dict_t *dict, char **op_errstr) goto out; } - if (strchr (brick, ':')) { - ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, NULL, - GF_PATH_COMPLETE); - if (ret) { - snprintf (msg, sizeof (msg), "Incorrect brick %s " - "for volume %s", brick, volname); - gf_log ("", GF_LOG_ERROR, "%s", msg); - *op_errstr = gf_strdup (msg); - goto out; - } + ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, NULL); + if (ret) { + snprintf (msg, sizeof (msg), "Incorrect brick %s " + "for volume %s", brick, volname); + gf_log ("", GF_LOG_ERROR, "%s", msg); + *op_errstr = gf_strdup (msg); + goto out; } out: gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); @@ -201,15 +198,11 @@ glusterd_op_log_rotate (dict_t *dict) if (ret) goto cont; - if (!strchr (brick, ':')) - brick = NULL; - else { - ret = glusterd_brickinfo_from_brick (brick, &tmpbrkinfo); - if (ret) { - gf_log ("glusterd", GF_LOG_ERROR, - "cannot get brickinfo from brick"); - goto out; - } + ret = glusterd_brickinfo_new_from_brick (brick, &tmpbrkinfo); + if (ret) { + gf_log ("glusterd", GF_LOG_ERROR, + "cannot get brickinfo from brick"); + goto out; } cont: |