From 1b5a860f159916f0b289069ef3223e6fd754d36b Mon Sep 17 00:00:00 2001 From: krishna Date: Thu, 4 Aug 2011 15:51:28 +0530 Subject: pass xlator pointer to rpcsvc_init() so that it can init svc->mydata to xlator Change-Id: Icfd95cc67400c16a951d6a9f922fbdc07f40c5b6 BUG: 3314 Reviewed-on: http://review.gluster.com/180 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- glusterfsd/src/glusterfsd-mgmt.c | 2 +- rpc/rpc-lib/src/rpcsvc.c | 3 ++- rpc/rpc-lib/src/rpcsvc.h | 3 ++- xlators/mgmt/glusterd/src/glusterd.c | 2 +- xlators/nfs/server/src/nfs.c | 2 +- xlators/protocol/server/src/server.c | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 91a6b69af7b..fbaa4e3cac0 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -830,7 +830,7 @@ glusterfs_listener_init (glusterfs_ctx_t *ctx) if (ret) goto out; - rpc = rpcsvc_init (ctx, options); + rpc = rpcsvc_init (THIS, ctx, options); if (rpc == NULL) { goto out; } diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 0c8e2b9436b..93952ec71e8 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -1786,7 +1786,7 @@ out: /* The global RPC service initializer. */ rpcsvc_t * -rpcsvc_init (glusterfs_ctx_t *ctx, dict_t *options) +rpcsvc_init (xlator_t *xl, glusterfs_ctx_t *ctx, dict_t *options) { rpcsvc_t *svc = NULL; int ret = -1, poolcount = 0; @@ -1830,6 +1830,7 @@ rpcsvc_init (glusterfs_ctx_t *ctx, dict_t *options) ret = -1; svc->options = options; svc->ctx = ctx; + svc->mydata = xl; gf_log (GF_RPCSVC, GF_LOG_DEBUG, "RPC service inited."); gluster_dump_prog.options = options; diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h index 78a0f415171..a28f3a4dbe8 100644 --- a/rpc/rpc-lib/src/rpcsvc.h +++ b/rpc/rpc-lib/src/rpcsvc.h @@ -34,6 +34,7 @@ #include "iobuf.h" #include "xdr-rpc.h" #include "glusterfs.h" +#include "xlator.h" #include "rpcsvc-common.h" #include @@ -423,7 +424,7 @@ rpcsvc_register_portmap_enabled (rpcsvc_t *svc); * Called in main. */ extern rpcsvc_t * -rpcsvc_init (glusterfs_ctx_t *ctx, dict_t *options); +rpcsvc_init (xlator_t *xl, glusterfs_ctx_t *ctx, dict_t *options); int rpcsvc_register_notify (rpcsvc_t *svc, rpcsvc_notify_t notify, void *mydata); diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 99710cab9ef..e4fd7608aeb 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -626,7 +626,7 @@ init (xlator_t *this) ret = glusterd_rpcsvc_options_build (this->options); if (ret) goto out; - rpc = rpcsvc_init (this->ctx, this->options); + rpc = rpcsvc_init (this, this->ctx, this->options); if (rpc == NULL) { gf_log (this->name, GF_LOG_ERROR, "failed to init rpc"); diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 1c38237fd24..57b9bb49296 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -499,7 +499,7 @@ nfs_init_state (xlator_t *this) /* RPC service needs to be started before NFS versions can be * inited. */ - nfs->rpcsvc = rpcsvc_init (this->ctx, this->options); + nfs->rpcsvc = rpcsvc_init (this, this->ctx, this->options); if (!nfs->rpcsvc) { gf_log (GF_NFS, GF_LOG_ERROR, "RPC service init failed"); goto free_nfs; diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 310a131c8b9..445e9f50fbf 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -672,7 +672,7 @@ init (xlator_t *this) /* RPC related */ //conf->rpc = rpc_svc_init (&conf->rpc_conf); - conf->rpc = rpcsvc_init (this->ctx, this->options); + conf->rpc = rpcsvc_init (this, this->ctx, this->options); if (conf->rpc == NULL) { gf_log (this->name, GF_LOG_WARNING, "creation of rpcsvc failed"); -- cgit