summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2018-06-14 14:46:24 +0530
committerKrutika Dhananjay <kdhananj@redhat.com>2018-06-15 10:16:29 +0530
commit337f5815a4fa9a961c72b249e1d6b1c6907e961d (patch)
tree3132d5b62e76ebba2da3bdec78f9c33d65b918c4 /xlators/protocol/client/src/client.c
parent10581852dfc36eb6ead0784cb2e984cd39ae2b10 (diff)
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 <kdhananj@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client.c')
-rw-r--r--xlators/protocol/client/src/client.c13
1 files changed, 7 insertions, 6 deletions
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;
}