diff options
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 36 | ||||
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.h | 9 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 35 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.h | 9 |
4 files changed, 19 insertions, 70 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index a27d0479193..e6c681df8f3 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1384,14 +1384,13 @@ out: int -rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, - int procnum, fop_cbk_fn_t cbkfn, - struct iovec *proghdr, int proghdrcount, - struct iovec *progpayload, int progpayloadcount, - struct iobref *iobref, void *frame, struct iovec *rsphdr, - int rsphdr_count, struct iovec *rsp_payload, - int rsp_payload_count, struct iobref *rsp_iobref, - gf_boolean_t *lost) +rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, + int procnum, fop_cbk_fn_t cbkfn, + struct iovec *proghdr, int proghdrcount, + struct iovec *progpayload, int progpayloadcount, + struct iobref *iobref, void *frame, struct iovec *rsphdr, + int rsphdr_count, struct iovec *rsp_payload, + int rsp_payload_count, struct iobref *rsp_iobref) { rpc_clnt_connection_t *conn = NULL; struct iobuf *request_iob = NULL; @@ -1402,7 +1401,6 @@ rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int proglen = 0; char new_iobref = 0; uint64_t callid = 0; - gf_boolean_t cbk_lost = _gf_true; if (!rpc || !prog || !frame) { goto out; @@ -1491,7 +1489,6 @@ rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, if ((ret >= 0) && frame) { /* Save the frame in queue */ - cbk_lost = _gf_false; __save_frame (rpc, frame, rpcreq); gf_log ("rpc-clnt", GF_LOG_TRACE, "submitted request " @@ -1522,31 +1519,12 @@ out: if (rpcreq) { rpcreq->rpc_status = -1; cbkfn (rpcreq, NULL, 0, frame); - cbk_lost = _gf_false; mem_put (rpcreq); } } - if (lost) - *lost = cbk_lost; return ret; } -int -rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, - int procnum, fop_cbk_fn_t cbkfn, - struct iovec *proghdr, int proghdrcount, - struct iovec *progpayload, int progpayloadcount, - struct iobref *iobref, void *frame, struct iovec *rsphdr, - int rsphdr_count, struct iovec *rsp_payload, - int rsp_payload_count, struct iobref *rsp_iobref) -{ - return rpc_clnt_submit2 (rpc, prog, procnum, cbkfn, proghdr, - proghdrcount, progpayload, progpayloadcount, - iobref, frame, rsphdr, rsphdr_count, - rsp_payload, rsp_payload_count, rsp_iobref, - NULL); -} - struct rpc_clnt * rpc_clnt_ref (struct rpc_clnt *rpc) diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h index 34612fcc452..0da1655590a 100644 --- a/rpc/rpc-lib/src/rpc-clnt.h +++ b/rpc/rpc-lib/src/rpc-clnt.h @@ -216,15 +216,6 @@ int rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int rsphdr_count, struct iovec *rsp_payload, int rsp_payload_count, struct iobref *rsp_iobref); -int rpc_clnt_submit2 (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, - int procnum, fop_cbk_fn_t cbkfn, - struct iovec *proghdr, int proghdrcount, - struct iovec *progpayload, int progpayloadcount, - struct iobref *iobref, void *frame, struct iovec *rsphdr, - int rsphdr_count, struct iovec *rsp_payload, - int rsp_payload_count, struct iobref *rsp_iobref, - gf_boolean_t *cbk_lost); - struct rpc_clnt * rpc_clnt_ref (struct rpc_clnt *rpc); diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 3cf3b5ddaa0..d8136ab8231 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -84,8 +84,7 @@ gd_brick_op_req_free (gd1_mgmt_brick_op_req *req) 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, - gf_boolean_t *cbk_lost) + int procnum, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc) { int ret = -1; struct iobuf *iobuf = NULL; @@ -128,9 +127,9 @@ gd_syncop_submit_request (struct rpc_clnt *rpc, void *req, frame->local = cookie; /* Send the msg */ - ret = rpc_clnt_submit2 (rpc, prog, procnum, cbkfn, &iov, count, NULL, - 0, iobref, frame, NULL, 0, NULL, 0, NULL, - cbk_lost); + ret = rpc_clnt_submit (rpc, prog, procnum, cbkfn, + &iov, count, NULL, 0, iobref, + frame, NULL, 0, NULL, 0, NULL); /* TODO: do we need to start ping also? */ @@ -256,16 +255,12 @@ gd_syncop_mgmt_lock (struct rpc_clnt *rpc, struct syncargs *args, { int ret = -1; gd1_mgmt_cluster_lock_req req = {{0},}; - gf_boolean_t cbk_lost = _gf_true; uuid_copy (req.uuid, my_uuid); ret = gd_syncop_submit_request (rpc, &req, args, &gd_mgmt_prog, GLUSTERD_MGMT_CLUSTER_LOCK, gd_syncop_mgmt_lock_cbk, - (xdrproc_t) xdr_gd1_mgmt_cluster_lock_req, - &cbk_lost); - if (cbk_lost) - synctask_barrier_wake(args); + (xdrproc_t) xdr_gd1_mgmt_cluster_lock_req); return ret; } @@ -316,16 +311,12 @@ gd_syncop_mgmt_unlock (struct rpc_clnt *rpc, struct syncargs *args, { int ret = -1; gd1_mgmt_cluster_unlock_req req = {{0},}; - gf_boolean_t cbk_lost = _gf_true; uuid_copy (req.uuid, my_uuid); ret = gd_syncop_submit_request (rpc, &req, args, &gd_mgmt_prog, GLUSTERD_MGMT_CLUSTER_UNLOCK, gd_syncop_mgmt_unlock_cbk, - (xdrproc_t) xdr_gd1_mgmt_cluster_lock_req, - &cbk_lost); - if (cbk_lost) - synctask_barrier_wake(args); + (xdrproc_t) xdr_gd1_mgmt_cluster_lock_req); return ret; } @@ -411,7 +402,6 @@ gd_syncop_mgmt_stage_op (struct rpc_clnt *rpc, struct syncargs *args, { gd1_mgmt_stage_op_req *req = NULL; int ret = -1; - gf_boolean_t cbk_lost = _gf_true; req = GF_CALLOC (1, sizeof (*req), gf_gld_mt_mop_stage_req_t); if (!req) @@ -428,13 +418,9 @@ gd_syncop_mgmt_stage_op (struct rpc_clnt *rpc, struct syncargs *args, ret = gd_syncop_submit_request (rpc, req, args, &gd_mgmt_prog, GLUSTERD_MGMT_STAGE_OP, gd_syncop_stage_op_cbk, - (xdrproc_t) xdr_gd1_mgmt_stage_op_req, - &cbk_lost); + (xdrproc_t) xdr_gd1_mgmt_stage_op_req); out: gd_stage_op_req_free (req); - if (cbk_lost) - synctask_barrier_wake(args); - return ret; } @@ -646,7 +632,6 @@ gd_syncop_mgmt_commit_op (struct rpc_clnt *rpc, struct syncargs *args, { gd1_mgmt_commit_op_req *req = NULL; int ret = -1; - gf_boolean_t cbk_lost = _gf_true; req = GF_CALLOC (1, sizeof (*req), gf_gld_mt_mop_commit_req_t); if (!req) @@ -663,13 +648,9 @@ gd_syncop_mgmt_commit_op (struct rpc_clnt *rpc, struct syncargs *args, ret = gd_syncop_submit_request (rpc, req, args, &gd_mgmt_prog, GLUSTERD_MGMT_COMMIT_OP , gd_syncop_commit_op_cbk, - (xdrproc_t) xdr_gd1_mgmt_commit_op_req, - &cbk_lost); + (xdrproc_t) xdr_gd1_mgmt_commit_op_req); out: gd_commit_op_req_free (req); - if (cbk_lost) - synctask_barrier_wake(args); - return ret; } diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h index 3e3980c442f..9318862e508 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.h +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h @@ -19,7 +19,7 @@ int ret = 0; \ struct synctask *task = NULL; \ glusterd_conf_t *conf= THIS->private; \ - gf_boolean_t cbk_lost = _gf_true; \ + \ task = synctask_get (); \ stb->task = task; \ \ @@ -28,9 +28,8 @@ synclock_unlock (&conf->big_lock); \ ret = gd_syncop_submit_request (rpc, req, stb, \ prog, procnum, cbk, \ - (xdrproc_t)xdrproc, \ - &cbk_lost); \ - if (!cbk_lost) \ + (xdrproc_t)xdrproc); \ + if (!ret) \ synctask_yield (stb->task); \ synclock_lock (&conf->big_lock); \ } while (0) @@ -39,7 +38,7 @@ 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, gf_boolean_t *cbk_lost); + xdrproc_t xdrproc); int gd_syncop_mgmt_lock (struct rpc_clnt *rpc, struct syncargs *arg, |