diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-10-03 04:14:19 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-03 02:57:52 -0700 |
commit | 53b8c7470f9e40c60c5eebd1fbad5c6d274f7ee5 (patch) | |
tree | fb58f75117c2ac2bf08b77b7b6a6c29e0cb5f100 /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | c0c419a3572307e71026144b8907a33b464f6066 (diff) |
mgmt/glusterd: changes for detach everywhere
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1765 (peer probe on removed-detached bricks)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1765
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 67b4ab62c1c..39c1d59240e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -2041,6 +2041,27 @@ out: return ret; } + +int +glusterd_handle_friend_update_delete (dict_t *dict) +{ + char *hostname = NULL; + int32_t ret = -1; + + GF_ASSERT (dict); + + ret = dict_get_str (dict, "hostname", &hostname); + if (ret) + goto out; + + ret = glusterd_friend_remove (NULL, hostname); + +out: + gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); + return ret; +} + + int glusterd_handle_friend_update (rpcsvc_request_t *req) { @@ -2060,6 +2081,7 @@ glusterd_handle_friend_update (rpcsvc_request_t *req) int count = 0; uuid_t uuid = {0,}; glusterd_peerctx_args_t args = {0}; + int32_t op = 0; GF_ASSERT (req); @@ -2099,6 +2121,15 @@ glusterd_handle_friend_update (rpcsvc_request_t *req) if (ret) goto out; + ret = dict_get_int32 (dict, "op", &op); + if (ret) + goto out; + + if (GD_FRIEND_UPDATE_DEL == op) { + ret = glusterd_handle_friend_update_delete (dict); + goto out; + } + args.mode = GD_MODE_SWITCH_ON; while ( i <= count) { snprintf (key, sizeof (key), "friend%d.uuid", i); |