summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-05-01 23:30:53 +0530
committerAnand Avati <avati@redhat.com>2012-05-21 16:50:57 -0700
commitf42dd77fb8cdf5ef439db2c0e8eb6468419998b7 (patch)
treea74fb997b1d95bba812287281cf01c133e402431 /xlators/protocol/client/src
parent0039e876e3bfd889a92e9b51332a7e3b2b93d4b7 (diff)
protocol: handle proper vector size for writev()/readv()
* fixes the offset handling issue when 'xdata' is sent in writev/readv fop at the transport layer itself. * client_writev() was not sending xdata on wire, fixed Change-Id: Ib5ced64c84d415f07032662017979c65d9a1a128 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 808078 Reviewed-on: http://review.gluster.com/3182 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src')
-rw-r--r--xlators/protocol/client/src/client3_1-fops.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c
index e17a650..07d55c8 100644
--- a/xlators/protocol/client/src/client3_1-fops.c
+++ b/xlators/protocol/client/src/client3_1-fops.c
@@ -2693,6 +2693,10 @@ client3_1_readv_cbk (struct rpc_req *req, struct iovec *iov, int count,
(rsp.xdata.xdata_len), ret,
rsp.op_errno, out);
+#ifdef GF_TESTING_IO_XDATA
+ dict_dump (xdata);
+#endif
+
out:
if (rsp.op_ret == -1) {
gf_log (this->name, GF_LOG_WARNING,
@@ -4010,6 +4014,17 @@ client3_1_writev (call_frame_t *frame, xlator_t *this, void *data)
memcpy (req.gfid, args->fd->inode->gfid, 16);
+#ifdef GF_TESTING_IO_XDATA
+ if (!args->xdata)
+ args->xdata = dict_new ();
+
+ ret = dict_set_str (args->xdata, "testing-the-xdata-key",
+ "testing-the-xdata-value");
+#endif
+
+ GF_PROTOCOL_DICT_SERIALIZE (this, args->xdata, (&req.xdata.xdata_val),
+ req.xdata.xdata_len, op_errno, unwind);
+
ret = client_submit_vec_request (this, &req, frame, conf->fops,
GFS3_OP_WRITE, client3_1_writev_cbk,
args->vector, args->count,