From 40d3ad15856c88d93d16264aa1f6bb55806aafde Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 28 Jul 2010 06:23:31 +0000 Subject: changes to rpc - use mem-pool for requests and saved_frames. - preserve the rpc_req structure till rpc invokes program's reply. This will enable us to store transport specific data that has to last till reply has come (eg., memory regions of chunk lists in case of rdma). - change signature of rpc_clnt_submit to accept rsphdr_vector and rsppayload_vector. The buffers pointed by these vectors will be from iobufs and these iobufs are added to an iobref which should also be passed as an arguement to rpc_clnt_submit. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875 --- xlators/protocol/server/src/server.h | 2 ++ xlators/protocol/server/src/server3_1-fops.c | 21 ++++++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'xlators/protocol/server') diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h index 81ac7edcc76..20853879f8c 100644 --- a/xlators/protocol/server/src/server.h +++ b/xlators/protocol/server/src/server.h @@ -162,6 +162,8 @@ struct _server_state { fd_t *fd; int flags; int wbflags; + struct iovec payload_vector; + int payload_count; struct iobuf *iobuf; struct iobref *iobref; diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 18ace876c7b..fb69cf8da28 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -2445,10 +2445,8 @@ server_writev_resume (call_frame_t *frame, xlator_t *bound_xl) if (state->resolve.op_ret != 0) goto err; - iov.iov_len = state->size; - - if (state->iobuf) { - iov.iov_base = state->iobuf->ptr; + if (state->payload_count) { + iov = state->payload_vector; } STACK_WIND (frame, server_writev_cbk, @@ -2987,10 +2985,10 @@ server_writev (rpcsvc_request_t *req) int -server_writev_vec (rpcsvc_request_t *req, struct iobuf *iobuf) +server_writev_vec (rpcsvc_request_t *req, struct iovec *payload, + int payload_count, struct iobref *iobref) { server_state_t *state = NULL; - struct iobref *iobref = NULL; call_frame_t *frame = NULL; gfs3_write_req args = {0,}; @@ -3022,14 +3020,11 @@ server_writev_vec (rpcsvc_request_t *req, struct iobuf *iobuf) state->resolve.fd_no = args.fd; state->offset = args.offset; - if (iobuf) { - iobref = iobref_new (); - iobref_add (iobref, iobuf); - - state->iobref = iobref; - state->iobuf = iobuf_ref (iobuf); - + if (payload_count != 0) { + state->iobref = iobref_ref (iobref); state->size = req->msg[1].iov_len; + state->payload_count = payload_count; + state->payload_vector = *payload; } resolve_and_resume (frame, server_writev_resume); -- cgit