diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-07-27 08:48:49 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-27 07:42:59 -0700 |
commit | 26cc6b015bb29f942194d1ca2a3dd21d5483d829 (patch) | |
tree | eba35c888e4354f026a503429f5b9bcada02b1b6 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 232235a9ddeaf33159ee8af809efee440b06c6d1 (diff) |
DVM: Changes for remove brick
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1220 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1220
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index fb76d1f0305..1d4a8d2ec69 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -626,6 +626,43 @@ out: int32_t +glusterd_brickinfo_get (char *brick, glusterd_volinfo_t *volinfo, + glusterd_brickinfo_t **brickinfo) +{ + int32_t ret = -1; + char *hostname = NULL; + char *path = NULL; + glusterd_brickinfo_t *tmp = NULL; + + GF_ASSERT (brick); + GF_ASSERT (brickinfo); + GF_ASSERT (volinfo); + + gf_log ("", GF_LOG_NORMAL, "brick: %s", brick); + + hostname = strtok (brick, ":"); + path = strtok (NULL, ":"); + + GF_ASSERT (hostname); + GF_ASSERT (path); + + list_for_each_entry (tmp, &volinfo->bricks, brick_list) { + + if ((!strcmp (tmp->hostname, hostname)) && + !strcmp (tmp->path, path)) { + gf_log ("", GF_LOG_NORMAL, "Found brick"); + ret = 0; + break; + } + } + + *brickinfo = tmp; + + gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); + return ret; +} + +int32_t glusterd_friend_cleanup (glusterd_peerinfo_t *peerinfo) { GF_ASSERT (peerinfo); |