diff options
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt.h')
| -rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.h | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h index 28b6f0e7f4d..2945265200b 100644 --- a/rpc/rpc-lib/src/rpc-clnt.h +++ b/rpc/rpc-lib/src/rpc-clnt.h @@ -11,9 +11,9 @@ #ifndef __RPC_CLNT_H #define __RPC_CLNT_H -#include "stack.h" +#include <glusterfs/stack.h> #include "rpc-transport.h" -#include "timer.h" +#include <glusterfs/timer.h> #include "xdr-common.h" #include "glusterfs3.h" @@ -52,8 +52,8 @@ struct saved_frame { }; void *capital_this; void *frame; - struct timeval saved_at; struct rpc_req *rpcreq; + struct timeval saved_at; rpc_transport_rsp_t rsp; }; @@ -85,8 +85,8 @@ typedef int (*rpcclnt_cb_fn)(struct rpc_clnt *rpc, void *mydata, void *data); */ typedef struct rpcclnt_actor_desc { char procname[32]; - int procnum; rpcclnt_cb_fn actor; + int procnum; } rpcclnt_cb_actor_t; /* Describes a program and its version along with the function pointers @@ -98,8 +98,6 @@ typedef struct rpcclnt_cb_program { int prognum; int progver; rpcclnt_cb_actor_t *actors; /* All procedure handlers */ - int numactors; /* Num actors in actor array */ - /* Program specific state handed to actors */ void *private; @@ -108,6 +106,8 @@ typedef struct rpcclnt_cb_program { /* Needed for passing back in cb_actor */ void *mydata; + int numactors; /* Num actors in actor array */ + } rpcclnt_cb_program_t; typedef struct rpc_auth_data { @@ -127,42 +127,43 @@ struct rpc_clnt_config { struct rpc_clnt_connection { pthread_mutex_t lock; + pthread_cond_t cond; rpc_transport_t *trans; struct rpc_clnt_config config; gf_timer_t *reconnect; gf_timer_t *timer; gf_timer_t *ping_timer; struct rpc_clnt *rpc_clnt; - char connected; - gf_boolean_t disconnected; struct saved_frames *saved_frames; - int32_t frame_timeout; struct timespec last_sent; struct timespec last_received; - int32_t ping_started; - char *name; - int32_t ping_timeout; uint64_t pingcnt; uint64_t msgcnt; uint64_t cleanup_gen; + char *name; + int32_t ping_started; + int32_t frame_timeout; + int32_t ping_timeout; + gf_boolean_t disconnected; + char connected; }; typedef struct rpc_clnt_connection rpc_clnt_connection_t; struct rpc_req { rpc_clnt_connection_t *conn; - uint32_t xid; struct iovec req[2]; - int reqcnt; struct iobref *req_iobref; struct iovec rsp[2]; int rspcnt; + int reqcnt; struct iobref *rsp_iobref; - int rpc_status; - rpc_auth_data_t verf; rpc_clnt_prog_t *prog; - int procnum; + rpc_auth_data_t verf; fop_cbk_fn_t cbkfn; void *conn_private; + int procnum; + int rpc_status; + uint32_t xid; }; typedef struct rpc_clnt { @@ -182,9 +183,9 @@ typedef struct rpc_clnt { glusterfs_ctx_t *ctx; gf_atomic_t refcount; + xlator_t *owner; int auth_value; char disabled; - xlator_t *owner; } rpc_clnt_t; struct rpc_clnt * @@ -250,15 +251,9 @@ int rpcclnt_cbk_program_register(struct rpc_clnt *svc, rpcclnt_cb_program_t *program, void *mydata); -void +int rpc_clnt_disable(struct rpc_clnt *rpc); -void -rpc_clnt_disconnect(struct rpc_clnt *rpc); - -char -rpc_clnt_is_disabled(struct rpc_clnt *rpc); - int rpc_clnt_mgmt_pmap_signout(glusterfs_ctx_t *ctx, char *brick_name); |
