diff options
author | shishir gowda <shishirng@gluster.com> | 2012-04-24 10:27:18 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-25 04:05:35 -0700 |
commit | 8f2eba00fd315b42aeaa01d683b765fbd2ee111b (patch) | |
tree | 18ef5e7b1aa828fce4e2a2c8fa1dfdc54e8d35c0 /xlators/mgmt/glusterd/src/glusterd-rebalance.c | |
parent | 3f35280a364bd35293d3e5804eb2a659a7f174b1 (diff) |
rebalance: handshake_event_notify to make fsd talk to glusterd
Event_notify can be used by others to communicate with glusterd.
A cbk event is also added for future use.
req has a op, and dict.
rsp has op_ret, op_errno, and dict.
With this, rebalance process can update the status before
exiting.
Signed-off-by: shishir gowda <shishirng@gluster.com>
Change-Id: If5c0ec00514eb3a109a790b2ea273317611e4562
BUG: 807126
Reviewed-on: http://review.gluster.com/3013
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index fddf6699f9e..9ed6af66741 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -677,3 +677,30 @@ out: return ret; } + +int32_t +glusterd_defrag_event_notify_handle (dict_t *dict) +{ + glusterd_volinfo_t *volinfo = NULL; + char *volname = NULL; + int32_t ret = -1; + + ret = dict_get_str (dict, "volname", &volname); + if (ret) { + gf_log ("", GF_LOG_ERROR, "Failed to get volname"); + return ret; + } + + ret = glusterd_volinfo_find (volname, &volinfo); + if (ret) { + gf_log ("", GF_LOG_ERROR, "Failed to get volinfo for %s" + , volname); + return ret; + } + + ret = glusterd_defrag_volume_status_update (volinfo, dict); + + if (ret) + gf_log ("", GF_LOG_ERROR, "Failed to update status"); + return ret; +} |