diff options
Diffstat (limited to 'include/linux/sunrpc/clnt.h')
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 8fe9f35eba31..f6d1d646ce05 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -18,18 +18,6 @@ | |||
| 18 | #include <linux/sunrpc/timer.h> | 18 | #include <linux/sunrpc/timer.h> |
| 19 | #include <asm/signal.h> | 19 | #include <asm/signal.h> |
| 20 | 20 | ||
| 21 | /* | ||
| 22 | * This defines an RPC port mapping | ||
| 23 | */ | ||
| 24 | struct rpc_portmap { | ||
| 25 | __u32 pm_prog; | ||
| 26 | __u32 pm_vers; | ||
| 27 | __u32 pm_prot; | ||
| 28 | __u16 pm_port; | ||
| 29 | unsigned char pm_binding : 1; /* doing a getport() */ | ||
| 30 | struct rpc_wait_queue pm_bindwait; /* waiting on getport() */ | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct rpc_inode; | 21 | struct rpc_inode; |
| 34 | 22 | ||
| 35 | /* | 23 | /* |
| @@ -40,7 +28,9 @@ struct rpc_clnt { | |||
| 40 | atomic_t cl_users; /* number of references */ | 28 | atomic_t cl_users; /* number of references */ |
| 41 | struct rpc_xprt * cl_xprt; /* transport */ | 29 | struct rpc_xprt * cl_xprt; /* transport */ |
| 42 | struct rpc_procinfo * cl_procinfo; /* procedure info */ | 30 | struct rpc_procinfo * cl_procinfo; /* procedure info */ |
| 43 | u32 cl_maxproc; /* max procedure number */ | 31 | u32 cl_prog, /* RPC program number */ |
| 32 | cl_vers, /* RPC version number */ | ||
| 33 | cl_maxproc; /* max procedure number */ | ||
| 44 | 34 | ||
| 45 | char * cl_server; /* server machine name */ | 35 | char * cl_server; /* server machine name */ |
| 46 | char * cl_protname; /* protocol name */ | 36 | char * cl_protname; /* protocol name */ |
| @@ -55,7 +45,6 @@ struct rpc_clnt { | |||
| 55 | cl_dead : 1;/* abandoned */ | 45 | cl_dead : 1;/* abandoned */ |
| 56 | 46 | ||
| 57 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ | 47 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ |
| 58 | struct rpc_portmap * cl_pmap; /* port mapping */ | ||
| 59 | 48 | ||
| 60 | int cl_nodelen; /* nodename length */ | 49 | int cl_nodelen; /* nodename length */ |
| 61 | char cl_nodename[UNX_MAXNODENAME]; | 50 | char cl_nodename[UNX_MAXNODENAME]; |
| @@ -64,14 +53,8 @@ struct rpc_clnt { | |||
| 64 | struct dentry * cl_dentry; /* inode */ | 53 | struct dentry * cl_dentry; /* inode */ |
| 65 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 54 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
| 66 | struct rpc_rtt cl_rtt_default; | 55 | struct rpc_rtt cl_rtt_default; |
| 67 | struct rpc_portmap cl_pmap_default; | ||
| 68 | char cl_inline_name[32]; | 56 | char cl_inline_name[32]; |
| 69 | }; | 57 | }; |
| 70 | #define cl_timeout cl_xprt->timeout | ||
| 71 | #define cl_prog cl_pmap->pm_prog | ||
| 72 | #define cl_vers cl_pmap->pm_vers | ||
| 73 | #define cl_port cl_pmap->pm_port | ||
| 74 | #define cl_prot cl_pmap->pm_prot | ||
| 75 | 58 | ||
| 76 | /* | 59 | /* |
| 77 | * General RPC program info | 60 | * General RPC program info |
| @@ -106,24 +89,36 @@ struct rpc_procinfo { | |||
| 106 | char * p_name; /* name of procedure */ | 89 | char * p_name; /* name of procedure */ |
| 107 | }; | 90 | }; |
| 108 | 91 | ||
| 109 | #define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt)) | ||
| 110 | #define RPC_PEERADDR(clnt) (&(clnt)->cl_xprt->addr) | ||
| 111 | |||
| 112 | #ifdef __KERNEL__ | 92 | #ifdef __KERNEL__ |
| 113 | 93 | ||
| 114 | struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname, | 94 | struct rpc_create_args { |
| 115 | struct rpc_program *info, | 95 | int protocol; |
| 116 | u32 version, rpc_authflavor_t authflavor); | 96 | struct sockaddr *address; |
| 117 | struct rpc_clnt *rpc_new_client(struct rpc_xprt *xprt, char *servname, | 97 | size_t addrsize; |
| 118 | struct rpc_program *info, | 98 | struct rpc_timeout *timeout; |
| 119 | u32 version, rpc_authflavor_t authflavor); | 99 | char *servername; |
| 100 | struct rpc_program *program; | ||
| 101 | u32 version; | ||
| 102 | rpc_authflavor_t authflavor; | ||
| 103 | unsigned long flags; | ||
| 104 | }; | ||
| 105 | |||
| 106 | /* Values for "flags" field */ | ||
| 107 | #define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) | ||
| 108 | #define RPC_CLNT_CREATE_INTR (1UL << 1) | ||
| 109 | #define RPC_CLNT_CREATE_AUTOBIND (1UL << 2) | ||
| 110 | #define RPC_CLNT_CREATE_ONESHOT (1UL << 3) | ||
| 111 | #define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 4) | ||
| 112 | #define RPC_CLNT_CREATE_NOPING (1UL << 5) | ||
| 113 | |||
| 114 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | ||
| 120 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 115 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
| 121 | struct rpc_program *, int); | 116 | struct rpc_program *, int); |
| 122 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 117 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
| 123 | int rpc_shutdown_client(struct rpc_clnt *); | 118 | int rpc_shutdown_client(struct rpc_clnt *); |
| 124 | int rpc_destroy_client(struct rpc_clnt *); | 119 | int rpc_destroy_client(struct rpc_clnt *); |
| 125 | void rpc_release_client(struct rpc_clnt *); | 120 | void rpc_release_client(struct rpc_clnt *); |
| 126 | void rpc_getport(struct rpc_task *, struct rpc_clnt *); | 121 | void rpc_getport(struct rpc_task *); |
| 127 | int rpc_register(u32, u32, int, unsigned short, int *); | 122 | int rpc_register(u32, u32, int, unsigned short, int *); |
| 128 | 123 | ||
| 129 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); | 124 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); |
| @@ -140,6 +135,8 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | |||
| 140 | size_t rpc_max_payload(struct rpc_clnt *); | 135 | size_t rpc_max_payload(struct rpc_clnt *); |
| 141 | void rpc_force_rebind(struct rpc_clnt *); | 136 | void rpc_force_rebind(struct rpc_clnt *); |
| 142 | int rpc_ping(struct rpc_clnt *clnt, int flags); | 137 | int rpc_ping(struct rpc_clnt *clnt, int flags); |
| 138 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | ||
| 139 | char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | ||
| 143 | 140 | ||
| 144 | /* | 141 | /* |
| 145 | * Helper function for NFSroot support | 142 | * Helper function for NFSroot support |
