diff options
Diffstat (limited to 'xlators/features/quota/src/quota-enforcer-client.c')
| -rw-r--r-- | xlators/features/quota/src/quota-enforcer-client.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/xlators/features/quota/src/quota-enforcer-client.c b/xlators/features/quota/src/quota-enforcer-client.c index 57105549cf8..480d64ade27 100644 --- a/xlators/features/quota/src/quota-enforcer-client.c +++ b/xlators/features/quota/src/quota-enforcer-client.c @@ -32,12 +32,6 @@ #include <malloc.h> #endif -#ifdef HAVE_MALLOC_STATS -#ifdef DEBUG -#include <mcheck.h> -#endif -#endif - #include "quota.h" #include "quota-messages.h" @@ -362,16 +356,28 @@ quota_enforcer_notify(struct rpc_clnt *rpc, void *mydata, { xlator_t *this = NULL; int ret = 0; + quota_priv_t *priv = NULL; this = mydata; - + priv = this->private; switch (event) { case RPC_CLNT_CONNECT: { + pthread_mutex_lock(&priv->conn_mutex); + { + priv->conn_status = _gf_true; + } + pthread_mutex_unlock(&priv->conn_mutex); gf_msg_trace(this->name, 0, "got RPC_CLNT_CONNECT"); break; } case RPC_CLNT_DISCONNECT: { + pthread_mutex_lock(&priv->conn_mutex); + { + priv->conn_status = _gf_false; + pthread_cond_signal(&priv->conn_cond); + } + pthread_mutex_unlock(&priv->conn_mutex); gf_msg_trace(this->name, 0, "got RPC_CLNT_DISCONNECT"); break; } @@ -395,7 +401,7 @@ quota_enforcer_blocking_connect(rpc_clnt_t *rpc) if (options == NULL) goto out; - ret = dict_set_str(options, "non-blocking-io", "no"); + ret = dict_set_sizen_str_sizen(options, "non-blocking-io", "no"); if (ret) goto out; @@ -403,7 +409,7 @@ quota_enforcer_blocking_connect(rpc_clnt_t *rpc) rpc_clnt_start(rpc); - ret = dict_set_str(options, "non-blocking-io", "yes"); + ret = dict_set_sizen_str_sizen(options, "non-blocking-io", "yes"); if (ret) goto out; @@ -442,16 +448,16 @@ quota_enforcer_init(xlator_t *this, dict_t *options) priv->quota_enforcer = "a_enforcer_clnt; - ret = dict_set_str(options, "transport.address-family", "unix"); + ret = dict_set_sizen_str_sizen(options, "transport.address-family", "unix"); if (ret) goto out; - ret = dict_set_str(options, "transport-type", "socket"); + ret = dict_set_sizen_str_sizen(options, "transport-type", "socket"); if (ret) goto out; - ret = dict_set_str(options, "transport.socket.connect-path", - "/var/run/gluster/quotad.socket"); + ret = dict_set_sizen_str_sizen(options, "transport.socket.connect-path", + "/var/run/gluster/quotad.socket"); if (ret) goto out; |
