diff options
author | shishir gowda <sgowda@redhat.com> | 2012-06-22 13:28:31 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-08-01 20:57:30 -0700 |
commit | 31e81065edc26378eabdd4785f5dd689719cd126 (patch) | |
tree | d2030cb65e91b98bf3aec6a8ecb97ce7e8a71319 /glusterfsd | |
parent | 84d0f889eab947b58a0f6e8d0eda5ae84c15a6c7 (diff) |
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 <sgowda@redhat.com>
Reviewed-on: http://review.gluster.com/3610
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index d8582aa7013..f313fa4c630 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; @@ -1928,6 +1929,24 @@ glusterfs_listener_stop (glusterfs_ctx_t *ctx) } 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) { cmd_args_t *cmd_args = NULL; @@ -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; |