hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/include/linux/sunrpc/clnt.h
....@@ -50,6 +50,7 @@
5050 struct rpc_iostats * cl_metrics; /* per-client statistics */
5151
5252 unsigned int cl_softrtry : 1,/* soft timeouts */
53
+ cl_softerr : 1,/* Timeouts return errors */
5354 cl_discrtry : 1,/* disconnect before retry */
5455 cl_noretranstimeo: 1,/* No retransmit timeouts */
5556 cl_autobind : 1,/* use getport() */
....@@ -66,10 +67,18 @@
6667 struct rpc_rtt cl_rtt_default;
6768 struct rpc_timeout cl_timeout_default;
6869 const struct rpc_program *cl_program;
70
+ const char * cl_principal; /* use for machine cred */
6971 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
7072 struct dentry *cl_debugfs; /* debugfs directory */
7173 #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;
7382 };
7483
7584 /*
....@@ -106,8 +115,6 @@
106115 const char * p_name; /* name of procedure */
107116 };
108117
109
-#ifdef __KERNEL__
110
-
111118 struct rpc_create_args {
112119 struct net *net;
113120 int protocol;
....@@ -121,14 +128,16 @@
121128 u32 prognumber; /* overrides program->number */
122129 u32 version;
123130 rpc_authflavor_t authflavor;
131
+ u32 nconnect;
124132 unsigned long flags;
125133 char *client_name;
126134 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */
135
+ const struct cred *cred;
127136 };
128137
129138 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,
132141 void *calldata);
133142 void *data;
134143 };
....@@ -143,6 +152,8 @@
143152 #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7)
144153 #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8)
145154 #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)
146157
147158 struct rpc_clnt *rpc_create(struct rpc_create_args *args);
148159 struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
....@@ -158,6 +169,8 @@
158169 void rpc_release_client(struct rpc_clnt *);
159170 void rpc_task_release_transport(struct rpc_task *);
160171 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);
161174
162175 int rpcb_create_local(struct net *);
163176 void rpcb_put_local(struct net *);
....@@ -168,6 +181,9 @@
168181 const char *netid);
169182 void rpcb_getport_async(struct rpc_task *);
170183
184
+void rpc_prepare_reply_pages(struct rpc_rqst *req, struct page **pages,
185
+ unsigned int base, unsigned int len,
186
+ unsigned int hdrsize);
171187 void rpc_call_start(struct rpc_task *);
172188 int rpc_call_async(struct rpc_clnt *clnt,
173189 const struct rpc_message *msg, int flags,
....@@ -183,6 +199,7 @@
183199 struct net * rpc_net_ns(struct rpc_clnt *);
184200 size_t rpc_max_payload(struct rpc_clnt *);
185201 size_t rpc_max_bc_payload(struct rpc_clnt *);
202
+unsigned int rpc_num_bc_slots(struct rpc_clnt *);
186203 void rpc_force_rebind(struct rpc_clnt *);
187204 size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
188205 const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
....@@ -225,5 +242,9 @@
225242 (task->tk_msg.rpc_proc->p_decode != NULL);
226243 }
227244
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
+}
229250 #endif /* _LINUX_SUNRPC_CLNT_H */