summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-rpc-fops_v2.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-rpc-fops_v2.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-rpc-fops_v2.c')
-rw-r--r--xlators/protocol/client/src/client-rpc-fops_v2.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops_v2.c b/xlators/protocol/client/src/client-rpc-fops_v2.c
index 7748a216a23..35731920a2e 100644
--- a/xlators/protocol/client/src/client-rpc-fops_v2.c
+++ b/xlators/protocol/client/src/client-rpc-fops_v2.c
@@ -23,13 +23,6 @@ client3_getspec (call_frame_t *frame, xlator_t *this, void *data);
extern int32_t
client3_3_getxattr (call_frame_t *frame, xlator_t *this, void *data);
-extern int
-client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame,
- rpc_clnt_prog_t *prog, int procnum,
- fop_cbk_fn_t cbkfn,
- struct iovec *payload, int payloadcnt,
- struct iobref *iobref, xdrproc_t xdrproc);
-
int
client4_0_symlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
void *myframe)
@@ -3770,11 +3763,11 @@ client4_0_writev (call_frame_t *frame, xlator_t *this, void *data)
goto unwind;
}
- ret = client_submit_vec_request (this, &req, frame, conf->fops,
- GFS3_OP_WRITE, client4_0_writev_cbk,
- args->vector, args->count,
- args->iobref,
- (xdrproc_t)xdr_gfx_write_req);
+ ret = client_submit_request (this, &req, frame, conf->fops,
+ GFS3_OP_WRITE, client4_0_writev_cbk,
+ args->iobref, args->vector, args->count,
+ NULL, 0, NULL,
+ (xdrproc_t)xdr_gfx_write_req);
if (ret) {
/*
* If the lower layers fail to submit a request, they'll also
@@ -5704,11 +5697,11 @@ client4_0_put (call_frame_t *frame, xlator_t *this, void *data)
goto unwind;
}
- ret = client_submit_vec_request (this, &req, frame, conf->fops,
- GFS3_OP_PUT, client4_0_put_cbk,
- args->vector, args->count,
- args->iobref,
- (xdrproc_t)xdr_gfx_put_req);
+ ret = client_submit_request (this, &req, frame, conf->fops,
+ GFS3_OP_PUT, client4_0_put_cbk,
+ args->iobref, args->vector, args->count,
+ NULL, 0, NULL,
+ (xdrproc_t)xdr_gfx_put_req);
if (ret) {
/*
* If the lower layers fail to submit a request, they'll also