From f42dd77fb8cdf5ef439db2c0e8eb6468419998b7 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 1 May 2012 23:30:53 +0530 Subject: 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 BUG: 808078 Reviewed-on: http://review.gluster.com/3182 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Tested-by: Jeff Darcy Reviewed-by: Anand Avati --- xlators/protocol/client/src/client3_1-fops.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'xlators/protocol/client/src/client3_1-fops.c') diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index e17a650d3c4..07d55c8956b 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, -- cgit