diff options
author | Anand Avati <avati@redhat.com> | 2013-11-27 05:09:57 -0800 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-12-05 10:05:21 -0800 |
commit | e3873729d820c0c2e63bb3bb878c39d79a16acf5 (patch) | |
tree | 0cd6fd60db6c93e1504e6db69c55627d73d71c93 /xlators/mgmt | |
parent | 550d83889857c1fe2c8eb04b1740a4884db7697d (diff) |
glusterd: submit RPC requests without holding big lock
If the endpoint of an RPC is not connected, the callback is called
synchronously within rpc_clnt_submit(). Since callbacks typically
hold the big lock, give up the big lock before calling rpc_clnt_submit
and acquire it freshly after the call.
Change-Id: Id89d8dd86c1a4012739ef4af7ea0935492b1a02b
BUG: 1037849
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/6415
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 2b45289406e..aba37c7fd9b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -225,10 +225,11 @@ glusterd_get_uuid (uuid_t *uuid) } int -glusterd_submit_request (struct rpc_clnt *rpc, void *req, - call_frame_t *frame, rpc_clnt_prog_t *prog, - int procnum, struct iobref *iobref, - xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) +glusterd_submit_request_unlocked (struct rpc_clnt *rpc, void *req, + call_frame_t *frame, rpc_clnt_prog_t *prog, + int procnum, struct iobref *iobref, + xlator_t *this, fop_cbk_fn_t cbkfn, + xdrproc_t xdrproc) { int ret = -1; struct iobuf *iobuf = NULL; @@ -299,6 +300,28 @@ out: return ret; } + +int +glusterd_submit_request (struct rpc_clnt *rpc, void *req, + call_frame_t *frame, rpc_clnt_prog_t *prog, + int procnum, struct iobref *iobref, + xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) +{ + glusterd_conf_t *priv = THIS->private; + int ret = -1; + + synclock_unlock (&priv->big_lock); + { + ret = glusterd_submit_request_unlocked (rpc, req, frame, prog, + procnum, iobref, this, + cbkfn, xdrproc); + } + synclock_lock (&priv->big_lock); + + return ret; +} + + struct iobuf * glusterd_serialize_reply (rpcsvc_request_t *req, void *arg, struct iovec *outmsg, xdrproc_t xdrproc) |