From 5a5148f07a808d1b94a116eb41a9452bd58ed6bb Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 22 Jun 2012 13:28:31 +0530 Subject: cluster/dht: Remove dht dependency on glusterfsd-mgmt glusterfs_ctx->notify can be used by any xlator to talk to glusterfsd-mgmt. Note- This is for any rpc communication initiated by the xlator, and not from glusterd. Change-Id: Ic0e4af106fe1e98d797ca621facda8839b87598a BUG: 835757 Signed-off-by: shishir gowda Reviewed-on: http://review.gluster.com/3618 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- glusterfsd/src/glusterfsd-mgmt.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 6122a76a36e..9984b42bb19 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -47,6 +47,7 @@ #include "cli1-xdr.h" #include "statedump.h" #include "syncop.h" +#include "xlator.h" static char is_mgmt_rpc_reconnect; @@ -1936,6 +1937,24 @@ glusterfs_listener_stop (glusterfs_ctx_t *ctx) return ret; } +int +glusterfs_mgmt_notify (int32_t op, void *data, ...) +{ + int ret = 0; + switch (op) + { + case GF_EN_DEFRAG_STATUS: + ret = glusterfs_rebalance_event_notify ((dict_t*) data); + break; + + default: + gf_log ("", GF_LOG_ERROR, "Invalid op"); + break; + } + + return ret; +} + int glusterfs_mgmt_init (glusterfs_ctx_t *ctx) { @@ -1981,6 +2000,8 @@ glusterfs_mgmt_init (glusterfs_ctx_t *ctx) goto out; } + ctx->notify = glusterfs_mgmt_notify; + /* This value should be set before doing the 'rpc_clnt_start()' as the notify function uses this variable */ ctx->mgmt = rpc; -- cgit