Skip to content

Commit 56632b5

Browse files
labiagaBenny Halevy
authored and
Benny Halevy
committedJun 17, 2009
nfs41: client callback structures
Adds new list of rpc_xprt structures, and a readers/writers lock to protect the list. The list is used to preallocate resources for the backchannel during backchannel requests. Callbacks are not expected to cause significant latency, so only one callback will be allowed at this time. It also adds a pointer to the NFS callback service so that requests can be directed to it for processing. New callback members added to svc_serv. The NFSv4.1 callback service will sleep on the svc_serv->svc_cb_waitq until new callback requests arrive. The request will be queued in svc_serv->svc_cb_list. This patch adds this list, the sleep queue and spinlock to svc_serv. [nfs41: NFSv4.1 callback support] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
1 parent 7146851 commit 56632b5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
 

‎include/linux/sunrpc/svc.h

+8
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ struct svc_serv {
9696
svc_thread_fn sv_function; /* main function for threads */
9797
unsigned int sv_drc_max_pages; /* Total pages for DRC */
9898
unsigned int sv_drc_pages_used;/* DRC pages used */
99+
#if defined(CONFIG_NFS_V4_1)
100+
struct list_head sv_cb_list; /* queue for callback requests
101+
* that arrive over the same
102+
* connection */
103+
spinlock_t sv_cb_lock; /* protects the svc_cb_list */
104+
wait_queue_head_t sv_cb_waitq; /* sleep here if there are no
105+
* entries in the svc_cb_list */
106+
#endif /* CONFIG_NFS_V4_1 */
99107
};
100108

101109
/*

‎include/linux/sunrpc/xprt.h

+22
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ struct rpc_rqst {
9797

9898
unsigned long rq_xtime; /* when transmitted */
9999
int rq_ntrans;
100+
101+
#if defined(CONFIG_NFS_V4_1)
102+
struct list_head rq_bc_list; /* Callback service list */
103+
unsigned long rq_bc_pa_state; /* Backchannel prealloc state */
104+
struct list_head rq_bc_pa_list; /* Backchannel prealloc list */
105+
#endif /* CONFIG_NFS_V4_1 */
100106
};
101107
#define rq_svec rq_snd_buf.head
102108
#define rq_slen rq_snd_buf.len
@@ -174,6 +180,14 @@ struct rpc_xprt {
174180
spinlock_t reserve_lock; /* lock slot table */
175181
u32 xid; /* Next XID value to use */
176182
struct rpc_task * snd_task; /* Task blocked in send */
183+
#if defined(CONFIG_NFS_V4_1)
184+
struct svc_serv *bc_serv; /* The RPC service which will */
185+
/* process the callback */
186+
spinlock_t bc_pa_lock; /* Protects the preallocated
187+
* items */
188+
struct list_head bc_pa_list; /* List of preallocated
189+
* backchannel rpc_rqst's */
190+
#endif /* CONFIG_NFS_V4_1 */
177191
struct list_head recv;
178192

179193
struct {
@@ -192,6 +206,14 @@ struct rpc_xprt {
192206
const char *address_strings[RPC_DISPLAY_MAX];
193207
};
194208

209+
#if defined(CONFIG_NFS_V4_1)
210+
/*
211+
* Backchannel flags
212+
*/
213+
#define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */
214+
/* buffer in use */
215+
#endif /* CONFIG_NFS_V4_1 */
216+
195217
struct xprt_create {
196218
int ident; /* XPRT_TRANSPORT identifier */
197219
struct sockaddr * srcaddr; /* optional local address */

0 commit comments

Comments
 (0)