aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2006-08-22 20:06:15 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:39 -0400
commitec739ef03dc926d05051c8c5838971445504470a (patch)
tree940d3dafd873c159c1279ade15ba11ede1d12983 /include/linux
parent9c5bf38d85a31b946664bcc21078ef5bb10672f7 (diff)
SUNRPC: Create a helper to tell whether a transport is bound
Hide the contents and format of xprt->addr by eliminating direct uses of the xprt->addr.sin_port field. This change is required to support alternate RPC host address formats (eg IPv6). Test-plan: Destructive testing (unplugging the network temporarily). Repeated runs of Connectathon locking suite with UDP and TCP. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sunrpc/xprt.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 3a0cca255b76..a71106723d71 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -269,6 +269,7 @@ int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to);
269#define XPRT_CONNECTED (1) 269#define XPRT_CONNECTED (1)
270#define XPRT_CONNECTING (2) 270#define XPRT_CONNECTING (2)
271#define XPRT_CLOSE_WAIT (3) 271#define XPRT_CLOSE_WAIT (3)
272#define XPRT_BOUND (4)
272 273
273static inline void xprt_set_connected(struct rpc_xprt *xprt) 274static inline void xprt_set_connected(struct rpc_xprt *xprt)
274{ 275{
@@ -312,6 +313,21 @@ static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt)
312 return test_and_set_bit(XPRT_CONNECTING, &xprt->state); 313 return test_and_set_bit(XPRT_CONNECTING, &xprt->state);
313} 314}
314 315
316static inline void xprt_set_bound(struct rpc_xprt *xprt)
317{
318 test_and_set_bit(XPRT_BOUND, &xprt->state);
319}
320
321static inline int xprt_bound(struct rpc_xprt *xprt)
322{
323 return test_bit(XPRT_BOUND, &xprt->state);
324}
325
326static inline void xprt_clear_bound(struct rpc_xprt *xprt)
327{
328 clear_bit(XPRT_BOUND, &xprt->state);
329}
330
315#endif /* __KERNEL__*/ 331#endif /* __KERNEL__*/
316 332
317#endif /* _LINUX_SUNRPC_XPRT_H */ 333#endif /* _LINUX_SUNRPC_XPRT_H */