aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/xprt.h
diff options
context:
space:
mode:
authorChuck Lever <cel@citi.umich.edu>2005-08-11 16:25:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-09-23 12:38:21 -0400
commit2226feb6bcd0e5e117a9be3ea3dd3ffc14f3e41e (patch)
tree5ae6bde4dd66da8932c23c780745c72cf38de722 /include/linux/sunrpc/xprt.h
parent5dc07727f86b25851e95193a0c484ea21b531c47 (diff)
[PATCH] RPC: rename the sockstate field
Clean-up: get rid of a name reference to sockets in the generic parts of the RPC client by renaming the sockstate field in the rpc_xprt structure. Test-plan: Compile kernel with CONFIG_NFS enabled. Version: Thu, 11 Aug 2005 16:05:53 -0400 Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/sunrpc/xprt.h')
-rw-r--r--include/linux/sunrpc/xprt.h60
1 files changed, 49 insertions, 11 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 41ce296dded1..009a3bb4f997 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -163,7 +163,7 @@ struct rpc_xprt {
163 struct list_head free; /* free slots */ 163 struct list_head free; /* free slots */
164 struct rpc_rqst * slot; /* slot table storage */ 164 struct rpc_rqst * slot; /* slot table storage */
165 unsigned int max_reqs; /* total slots */ 165 unsigned int max_reqs; /* total slots */
166 unsigned long sockstate; /* Socket state */ 166 unsigned long state; /* transport state */
167 unsigned char shutdown : 1, /* being shut down */ 167 unsigned char shutdown : 1, /* being shut down */
168 nocong : 1, /* no congestion control */ 168 nocong : 1, /* no congestion control */
169 resvport : 1, /* use a reserved port */ 169 resvport : 1, /* use a reserved port */
@@ -240,16 +240,54 @@ int xs_setup_udp(struct rpc_xprt *,
240int xs_setup_tcp(struct rpc_xprt *, 240int xs_setup_tcp(struct rpc_xprt *,
241 struct rpc_timeout *); 241 struct rpc_timeout *);
242 242
243#define XPRT_LOCKED 0 243/*
244#define XPRT_CONNECT 1 244 * Reserved bit positions in xprt->state
245#define XPRT_CONNECTING 2 245 */
246 246#define XPRT_LOCKED (0)
247#define xprt_connected(xp) (test_bit(XPRT_CONNECT, &(xp)->sockstate)) 247#define XPRT_CONNECTED (1)
248#define xprt_set_connected(xp) (set_bit(XPRT_CONNECT, &(xp)->sockstate)) 248#define XPRT_CONNECTING (2)
249#define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) 249
250#define xprt_test_and_clear_connected(xp) \ 250static inline void xprt_set_connected(struct rpc_xprt *xprt)
251 (test_and_clear_bit(XPRT_CONNECT, &(xp)->sockstate)) 251{
252#define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) 252 set_bit(XPRT_CONNECTED, &xprt->state);
253}
254
255static inline void xprt_clear_connected(struct rpc_xprt *xprt)
256{
257 clear_bit(XPRT_CONNECTED, &xprt->state);
258}
259
260static inline int xprt_connected(struct rpc_xprt *xprt)
261{
262 return test_bit(XPRT_CONNECTED, &xprt->state);
263}
264
265static inline int xprt_test_and_set_connected(struct rpc_xprt *xprt)
266{
267 return test_and_set_bit(XPRT_CONNECTED, &xprt->state);
268}
269
270static inline int xprt_test_and_clear_connected(struct rpc_xprt *xprt)
271{
272 return test_and_clear_bit(XPRT_CONNECTED, &xprt->state);
273}
274
275static inline void xprt_clear_connecting(struct rpc_xprt *xprt)
276{
277 smp_mb__before_clear_bit();
278 clear_bit(XPRT_CONNECTING, &xprt->state);
279 smp_mb__after_clear_bit();
280}
281
282static inline int xprt_connecting(struct rpc_xprt *xprt)
283{
284 return test_bit(XPRT_CONNECTING, &xprt->state);
285}
286
287static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt)
288{
289 return test_and_set_bit(XPRT_CONNECTING, &xprt->state);
290}
253 291
254#endif /* __KERNEL__*/ 292#endif /* __KERNEL__*/
255 293