diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-09-05 12:55:57 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-09-22 23:25:01 -0400 |
commit | 6b6ca86b77b62b798cf9ca2599036420abce7796 (patch) | |
tree | cf631a3c293be45fa4bed54bca5dcbfc96a57df1 /include | |
parent | da45828e2835057045150b318c4fbe9bb91f18dd (diff) |
SUNRPC: Add refcounting to the struct rpc_xprt
In a subsequent patch, this will allow the portmapper to take a reference
to the rpc_xprt for which it is updating the port number, fixing an Oops.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/xprt.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index de4efea7c856..bdeba8538c71 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
13 | #include <linux/socket.h> | 13 | #include <linux/socket.h> |
14 | #include <linux/in.h> | 14 | #include <linux/in.h> |
15 | #include <linux/kref.h> | ||
15 | #include <linux/sunrpc/sched.h> | 16 | #include <linux/sunrpc/sched.h> |
16 | #include <linux/sunrpc/xdr.h> | 17 | #include <linux/sunrpc/xdr.h> |
17 | 18 | ||
@@ -129,6 +130,7 @@ struct rpc_xprt_ops { | |||
129 | }; | 130 | }; |
130 | 131 | ||
131 | struct rpc_xprt { | 132 | struct rpc_xprt { |
133 | struct kref kref; /* Reference count */ | ||
132 | struct rpc_xprt_ops * ops; /* transport methods */ | 134 | struct rpc_xprt_ops * ops; /* transport methods */ |
133 | struct socket * sock; /* BSD socket layer */ | 135 | struct socket * sock; /* BSD socket layer */ |
134 | struct sock * inet; /* INET layer */ | 136 | struct sock * inet; /* INET layer */ |
@@ -248,7 +250,8 @@ int xprt_adjust_timeout(struct rpc_rqst *req); | |||
248 | void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); | 250 | void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
249 | void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | 251 | void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
250 | void xprt_release(struct rpc_task *task); | 252 | void xprt_release(struct rpc_task *task); |
251 | int xprt_destroy(struct rpc_xprt *xprt); | 253 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); |
254 | void xprt_put(struct rpc_xprt *xprt); | ||
252 | 255 | ||
253 | static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) | 256 | static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) |
254 | { | 257 | { |