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 --- rpc/rpc-lib/src/rpcsvc.h | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'rpc/rpc-lib/src/rpcsvc.h') diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h index 10dc32698..5a3f3cd34 100644 --- a/rpc/rpc-lib/src/rpcsvc.h +++ b/rpc/rpc-lib/src/rpcsvc.h @@ -237,21 +237,9 @@ struct rpcsvc_request { * be de-xdred by the actor. */ struct iovec msg[2]; + int count; - /* The full message buffer allocated to store the RPC headers. - * This buffer is ref'd when allocated why RPC svc and unref'd after - * the buffer is handed to the actor. That means if the actor or any - * higher layer wants to keep this buffer around, they too must ref it - * right after entering the program actor. - */ - struct iobuf *recordiob; - - /* iobuf to hold payload of calls like write. By storing large payloads - * starting from page-aligned addresses, performance increases while - * accessing the payload - */ - struct iobuf *vectorediob; - + struct iobref *iobref; /* Status of the RPC call, whether it was accepted or denied. */ int rpc_status; @@ -317,7 +305,6 @@ struct rpcsvc_request { #define rpcsvc_request_private(req) ((req)->private) #define rpcsvc_request_xid(req) ((req)->xid) #define rpcsvc_request_set_private(req,prv) (req)->private = (void *)(prv) -#define rpcsvc_request_record_iob(rq) ((rq)->recordiob) #define rpcsvc_request_record_ref(req) (iobuf_ref ((req)->recordiob)) #define rpcsvc_request_record_unref(req) (iobuf_unref ((req)->recordiob)) @@ -338,7 +325,8 @@ struct rpcsvc_request { * */ typedef int (*rpcsvc_actor) (rpcsvc_request_t *req); -typedef int (*rpcsvc_vector_actor) (rpcsvc_request_t *req, struct iobuf *iob); +typedef int (*rpcsvc_vector_actor) (rpcsvc_request_t *req, struct iovec *vec, + int count, struct iobref *iobref); typedef int (*rpcsvc_vector_sizer) (rpcsvc_request_t *req, ssize_t *readsize, int *newiob); -- cgit