.. | .. |
---|
50 | 50 | struct rpc_iostats * cl_metrics; /* per-client statistics */ |
---|
51 | 51 | |
---|
52 | 52 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
---|
| 53 | + cl_softerr : 1,/* Timeouts return errors */ |
---|
53 | 54 | cl_discrtry : 1,/* disconnect before retry */ |
---|
54 | 55 | cl_noretranstimeo: 1,/* No retransmit timeouts */ |
---|
55 | 56 | cl_autobind : 1,/* use getport() */ |
---|
.. | .. |
---|
66 | 67 | struct rpc_rtt cl_rtt_default; |
---|
67 | 68 | struct rpc_timeout cl_timeout_default; |
---|
68 | 69 | const struct rpc_program *cl_program; |
---|
| 70 | + const char * cl_principal; /* use for machine cred */ |
---|
69 | 71 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
---|
70 | 72 | struct dentry *cl_debugfs; /* debugfs directory */ |
---|
71 | 73 | #endif |
---|
72 | | - struct rpc_xprt_iter cl_xpi; |
---|
| 74 | + /* cl_work is only needed after cl_xpi is no longer used, |
---|
| 75 | + * and that are of similar size |
---|
| 76 | + */ |
---|
| 77 | + union { |
---|
| 78 | + struct rpc_xprt_iter cl_xpi; |
---|
| 79 | + struct work_struct cl_work; |
---|
| 80 | + }; |
---|
| 81 | + const struct cred *cl_cred; |
---|
73 | 82 | }; |
---|
74 | 83 | |
---|
75 | 84 | /* |
---|
.. | .. |
---|
106 | 115 | const char * p_name; /* name of procedure */ |
---|
107 | 116 | }; |
---|
108 | 117 | |
---|
109 | | -#ifdef __KERNEL__ |
---|
110 | | - |
---|
111 | 118 | struct rpc_create_args { |
---|
112 | 119 | struct net *net; |
---|
113 | 120 | int protocol; |
---|
.. | .. |
---|
121 | 128 | u32 prognumber; /* overrides program->number */ |
---|
122 | 129 | u32 version; |
---|
123 | 130 | rpc_authflavor_t authflavor; |
---|
| 131 | + u32 nconnect; |
---|
124 | 132 | unsigned long flags; |
---|
125 | 133 | char *client_name; |
---|
126 | 134 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ |
---|
| 135 | + const struct cred *cred; |
---|
127 | 136 | }; |
---|
128 | 137 | |
---|
129 | 138 | struct rpc_add_xprt_test { |
---|
130 | | - int (*add_xprt_test)(struct rpc_clnt *, |
---|
131 | | - struct rpc_xprt *, |
---|
| 139 | + void (*add_xprt_test)(struct rpc_clnt *clnt, |
---|
| 140 | + struct rpc_xprt *xprt, |
---|
132 | 141 | void *calldata); |
---|
133 | 142 | void *data; |
---|
134 | 143 | }; |
---|
.. | .. |
---|
143 | 152 | #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) |
---|
144 | 153 | #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8) |
---|
145 | 154 | #define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9) |
---|
| 155 | +#define RPC_CLNT_CREATE_SOFTERR (1UL << 10) |
---|
| 156 | +#define RPC_CLNT_CREATE_REUSEPORT (1UL << 11) |
---|
146 | 157 | |
---|
147 | 158 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
---|
148 | 159 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
---|
.. | .. |
---|
158 | 169 | void rpc_release_client(struct rpc_clnt *); |
---|
159 | 170 | void rpc_task_release_transport(struct rpc_task *); |
---|
160 | 171 | void rpc_task_release_client(struct rpc_task *); |
---|
| 172 | +struct rpc_xprt *rpc_task_get_xprt(struct rpc_clnt *clnt, |
---|
| 173 | + struct rpc_xprt *xprt); |
---|
161 | 174 | |
---|
162 | 175 | int rpcb_create_local(struct net *); |
---|
163 | 176 | void rpcb_put_local(struct net *); |
---|
.. | .. |
---|
168 | 181 | const char *netid); |
---|
169 | 182 | void rpcb_getport_async(struct rpc_task *); |
---|
170 | 183 | |
---|
| 184 | +void rpc_prepare_reply_pages(struct rpc_rqst *req, struct page **pages, |
---|
| 185 | + unsigned int base, unsigned int len, |
---|
| 186 | + unsigned int hdrsize); |
---|
171 | 187 | void rpc_call_start(struct rpc_task *); |
---|
172 | 188 | int rpc_call_async(struct rpc_clnt *clnt, |
---|
173 | 189 | const struct rpc_message *msg, int flags, |
---|
.. | .. |
---|
183 | 199 | struct net * rpc_net_ns(struct rpc_clnt *); |
---|
184 | 200 | size_t rpc_max_payload(struct rpc_clnt *); |
---|
185 | 201 | size_t rpc_max_bc_payload(struct rpc_clnt *); |
---|
| 202 | +unsigned int rpc_num_bc_slots(struct rpc_clnt *); |
---|
186 | 203 | void rpc_force_rebind(struct rpc_clnt *); |
---|
187 | 204 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
---|
188 | 205 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
---|
.. | .. |
---|
225 | 242 | (task->tk_msg.rpc_proc->p_decode != NULL); |
---|
226 | 243 | } |
---|
227 | 244 | |
---|
228 | | -#endif /* __KERNEL__ */ |
---|
| 245 | +static inline void rpc_task_close_connection(struct rpc_task *task) |
---|
| 246 | +{ |
---|
| 247 | + if (task->tk_xprt) |
---|
| 248 | + xprt_force_disconnect(task->tk_xprt); |
---|
| 249 | +} |
---|
229 | 250 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
---|