From 337f5815a4fa9a961c72b249e1d6b1c6907e961d Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 14 Jun 2018 14:46:24 +0530 Subject: protocol/client: Remove code duplication client_submit_vec_request() which is used by WRITEV, and PUT and client_submit_request() used by the rest of the fops have almost similar code. However, there have been some more checks - such as whether setvolume was successful or not, and one more that is send-gid-specific - that have been missed out in the vectored version of the function. This patch fixes this code duplication. Change-Id: I363a28eeead6219cb1009dc831538153e8bd7d40 fixes: bz#1591580 Signed-off-by: Krutika Dhananjay --- xlators/protocol/client/src/client.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'xlators/protocol/client/src/client.c') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 078236647ad..0d0267d8f62 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -129,8 +129,8 @@ client_type_to_gf_type (short l_type) int client_submit_request (xlator_t *this, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbkfn, - struct iobref *iobref, struct iovec *rsphdr, - int rsphdr_count, struct iovec *rsp_payload, + struct iobref *iobref, struct iovec *payload, + int payloadcnt, struct iovec *rsp_payload, int rsp_payload_count, struct iobref *rsp_iobref, xdrproc_t xdrproc) { @@ -169,7 +169,7 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, iobuf = iobuf_get2 (this->ctx->iobuf_pool, xdr_size); if (!iobuf) { goto out; - }; + } new_iobref = iobref_new (); if (!new_iobref) { @@ -221,8 +221,9 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, /* Send the msg */ ret = rpc_clnt_submit (conf->rpc, prog, procnum, cbkfn, &iov, count, - NULL, 0, new_iobref, frame, rsphdr, rsphdr_count, - rsp_payload, rsp_payload_count, rsp_iobref); + payload, payloadcnt, new_iobref, frame, + payload, payloadcnt, rsp_payload, + rsp_payload_count, rsp_iobref); if (ret < 0) { gf_msg_debug (this->name, 0, "rpc_clnt_submit failed"); @@ -249,7 +250,7 @@ out: if (iobuf) iobuf_unref (iobuf); - return 0; + return ret; } -- cgit