From 31e81065edc26378eabdd4785f5dd689719cd126 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/3610 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- 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 d8582aa70..f313fa4c6 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; @@ -1927,6 +1928,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) { @@ -1972,6 +1991,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