diff options
author | Kaushal M <kaushal@redhat.com> | 2013-05-23 12:19:33 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-06-04 13:27:35 -0700 |
commit | 0c1916f3e1eb81aa81dc2d62e97f46880390838c (patch) | |
tree | e82396844066f43718bddb42f6376adbe8064568 /xlators/mgmt/glusterd/src/glusterd-syncop.h | |
parent | a72e77f7bc5abfa739f19f6d02e7cf94b138c477 (diff) |
glusterd-syncop: Fix unlocking and collating errors
* Only those peers which were locked need to be unlocked.
* Fix location of collating errors in callbacks. The callback functions
could miss collating errors if there was an rpc error.
Change-Id: Ie27c2f1ec197da4f5077a4d6e032127954ce87cd
BUG: 948686
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5087
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.h')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h index 9318862e508..7e4d47f9a8e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.h +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h @@ -11,39 +11,39 @@ #define __RPC_SYNCOP_H #include "syncop.h" +#include "glusterd-sm.h" #define GD_SYNC_OPCODE_KEY "sync-mgmt-operation" /* gd_syncop_* */ -#define GD_SYNCOP(rpc, stb, cbk, req, prog, procnum, xdrproc) do { \ - int ret = 0; \ - struct synctask *task = NULL; \ - glusterd_conf_t *conf= THIS->private; \ - \ - task = synctask_get (); \ - stb->task = task; \ - \ - /*This is to ensure that the brick_op_cbk is able to \ - * take the big lock*/ \ - synclock_unlock (&conf->big_lock); \ - ret = gd_syncop_submit_request (rpc, req, stb, \ - prog, procnum, cbk, \ - (xdrproc_t)xdrproc); \ - if (!ret) \ - synctask_yield (stb->task); \ - synclock_lock (&conf->big_lock); \ +#define GD_SYNCOP(rpc, stb, cookie, cbk, req, prog, procnum, xdrproc) do { \ + int ret = 0; \ + struct synctask *task = NULL; \ + glusterd_conf_t *conf= THIS->private; \ + \ + task = synctask_get (); \ + stb->task = task; \ + \ + /*This is to ensure that the brick_op_cbk is able to \ + * take the big lock*/ \ + synclock_unlock (&conf->big_lock); \ + ret = gd_syncop_submit_request (rpc, req, stb, cookie, \ + prog, procnum, cbk, \ + (xdrproc_t)xdrproc); \ + if (!ret) \ + synctask_yield (stb->task); \ + synclock_lock (&conf->big_lock); \ } while (0) -int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req, - void *cookie, rpc_clnt_prog_t *prog, - int procnum, fop_cbk_fn_t cbkfn, - xdrproc_t xdrproc); +int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req, void *local, + void *cookie, rpc_clnt_prog_t *prog, int procnum, + fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); -int gd_syncop_mgmt_lock (struct rpc_clnt *rpc, struct syncargs *arg, +int gd_syncop_mgmt_lock (glusterd_peerinfo_t *peerinfo, struct syncargs *arg, uuid_t my_uuid, uuid_t recv_uuid); -int gd_syncop_mgmt_unlock (struct rpc_clnt *rpc, struct syncargs *arg, +int gd_syncop_mgmt_unlock (glusterd_peerinfo_t *peerinfo, struct syncargs *arg, uuid_t my_uuid, uuid_t recv_uuid); int gd_syncop_mgmt_stage_op (struct rpc_clnt *rpc, struct syncargs *arg, uuid_t my_uuid, uuid_t recv_uuid, int op, |