aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/svc_xprt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sunrpc/svc_xprt.h')
-rw-r--r--include/linux/sunrpc/svc_xprt.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 5f4e18b3ce73..bbdb680ffbe9 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -12,6 +12,7 @@
12 12
13struct svc_xprt_ops { 13struct svc_xprt_ops {
14 struct svc_xprt *(*xpo_create)(struct svc_serv *, 14 struct svc_xprt *(*xpo_create)(struct svc_serv *,
15 struct net *net,
15 struct sockaddr *, int, 16 struct sockaddr *, int,
16 int); 17 int);
17 struct svc_xprt *(*xpo_accept)(struct svc_xprt *); 18 struct svc_xprt *(*xpo_accept)(struct svc_xprt *);
@@ -32,6 +33,16 @@ struct svc_xprt_class {
32 u32 xcl_max_payload; 33 u32 xcl_max_payload;
33}; 34};
34 35
36/*
37 * This is embedded in an object that wants a callback before deleting
38 * an xprt; intended for use by NFSv4.1, which needs to know when a
39 * client's tcp connection (and hence possibly a backchannel) goes away.
40 */
41struct svc_xpt_user {
42 struct list_head list;
43 void (*callback)(struct svc_xpt_user *);
44};
45
35struct svc_xprt { 46struct svc_xprt {
36 struct svc_xprt_class *xpt_class; 47 struct svc_xprt_class *xpt_class;
37 struct svc_xprt_ops *xpt_ops; 48 struct svc_xprt_ops *xpt_ops;
@@ -66,14 +77,31 @@ struct svc_xprt {
66 struct sockaddr_storage xpt_remote; /* remote peer's address */ 77 struct sockaddr_storage xpt_remote; /* remote peer's address */
67 size_t xpt_remotelen; /* length of address */ 78 size_t xpt_remotelen; /* length of address */
68 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ 79 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */
80 struct list_head xpt_users; /* callbacks on free */
81
82 struct net *xpt_net;
69}; 83};
70 84
85static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
86{
87 spin_lock(&xpt->xpt_lock);
88 list_add(&u->list, &xpt->xpt_users);
89 spin_unlock(&xpt->xpt_lock);
90}
91
92static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
93{
94 spin_lock(&xpt->xpt_lock);
95 list_del_init(&u->list);
96 spin_unlock(&xpt->xpt_lock);
97}
98
71int svc_reg_xprt_class(struct svc_xprt_class *); 99int svc_reg_xprt_class(struct svc_xprt_class *);
72void svc_unreg_xprt_class(struct svc_xprt_class *); 100void svc_unreg_xprt_class(struct svc_xprt_class *);
73void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, 101void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *,
74 struct svc_serv *); 102 struct svc_serv *);
75int svc_create_xprt(struct svc_serv *, const char *, const int, 103int svc_create_xprt(struct svc_serv *, const char *, struct net *,
76 const unsigned short, int); 104 const int, const unsigned short, int);
77void svc_xprt_enqueue(struct svc_xprt *xprt); 105void svc_xprt_enqueue(struct svc_xprt *xprt);
78void svc_xprt_received(struct svc_xprt *); 106void svc_xprt_received(struct svc_xprt *);
79void svc_xprt_put(struct svc_xprt *xprt); 107void svc_xprt_put(struct svc_xprt *xprt);