From e82ca8fc5164f4ba2ff396da86b4a490d9a47370 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 23 Jun 2010 02:55:21 +0000 Subject: minor improvements in protocol * rpc_clnt_submit() now takes 'cbkfn' as an argument. * readdir xdr now uses dirent structure directly instead of using 'opaque' buffer through which it was serializing / unserializing the dirent structure. * 'gfs_id' field (currently used for debugging) is properly updated Signed-off-by: Amar Tumballi 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/rpc/rpc-lib/src/rpc-clnt.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'xlators/protocol/rpc/rpc-lib/src/rpc-clnt.h') diff --git a/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.h b/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.h index 89942ce7f57..efc256cd261 100644 --- a/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.h +++ b/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.h @@ -45,8 +45,7 @@ typedef int (*rpc_clnt_notify_t) (struct rpc_clnt *rpc, void *mydata, typedef int (*fop_cbk_fn_t) (struct rpc_req *req, struct iovec *iov, int count, void *myframe); -typedef int (*clnt_fn_t) (call_frame_t *, xlator_t *, - struct rpc_clnt_program *, void *args); +typedef int (*clnt_fn_t) (call_frame_t *fr, xlator_t *xl, void *args); struct saved_frame { union { @@ -61,37 +60,29 @@ struct saved_frame { struct timeval saved_at; int32_t procnum; struct rpc_clnt_program *prog; + fop_cbk_fn_t cbkfn; uint64_t callid; rpc_transport_rsp_t rsp; }; - struct saved_frames { int64_t count; struct saved_frame sf; }; -/* TODO: */ -struct xptr_clnt { - int remote_port; - char * remote_host; - - /* xptr specific */ - peer_info_t peerinfo; -}; /* Initialized by procnum */ typedef struct rpc_clnt_procedure { char *procname; clnt_fn_t fn; - fop_cbk_fn_t cbkfn; } rpc_clnt_procedure_t; typedef struct rpc_clnt_program { char *progname; int prognum; int progver; - rpc_clnt_procedure_t *actor; + rpc_clnt_procedure_t *proctable; + char **procnames; int numproc; } rpc_clnt_prog_t; @@ -158,7 +149,8 @@ struct rpc_clnt * rpc_clnt_init (struct rpc_clnt_config *config, int rpc_clnt_register_notify (struct rpc_clnt *rpc, rpc_clnt_notify_t fn, void *mydata); -int rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int procnum, +int rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, + int procnum, fop_cbk_fn_t cbkfn, struct iovec *proghdr, int proghdrcount, struct iovec *progpayload, int progpayloadcount, struct iobref *iobref, void *frame); -- cgit