1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
/****************************************************************************
****************************************************************************
***
*** This header was automatically generated from a Linux kernel header
*** of the same name, to make information necessary for userspace to
*** call into the kernel available to libc. It contains only constants,
*** structures, and macros generated from the original header, and thus,
*** contains no copyrightable information.
***
****************************************************************************
****************************************************************************/
#ifndef _LINUX_SUNRPC_XPRT_H
#define _LINUX_SUNRPC_XPRT_H
#include <linux/uio.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <linux/sunrpc/sched.h>
#include <linux/sunrpc/xdr.h>
#define RPC_MIN_SLOT_TABLE (2U)
#define RPC_DEF_SLOT_TABLE (16U)
#define RPC_MAX_SLOT_TABLE (128U)
#define RPC_CALLHDRSIZE 6
#define RPC_REPHDRSIZE 4
#define RPC_MIN_RESVPORT (1U)
#define RPC_MAX_RESVPORT (65535U)
#define RPC_DEF_MIN_RESVPORT (665U)
#define RPC_DEF_MAX_RESVPORT (1023U)
struct rpc_timeout {
unsigned long to_initval,
to_maxval,
to_increment;
unsigned int to_retries;
unsigned char to_exponential;
};
struct rpc_task;
struct rpc_xprt;
struct seq_file;
struct rpc_rqst {
struct rpc_xprt * rq_xprt;
struct xdr_buf rq_snd_buf;
struct xdr_buf rq_rcv_buf;
struct rpc_task * rq_task;
__u32 rq_xid;
int rq_cong;
int rq_received;
u32 rq_seqno;
int rq_enc_pages_num;
struct page **rq_enc_pages;
void (*rq_release_snd_buf)(struct rpc_rqst *);
struct list_head rq_list;
__u32 * rq_buffer;
size_t rq_bufsize;
struct xdr_buf rq_private_buf;
unsigned long rq_majortimeo;
unsigned long rq_timeout;
unsigned int rq_retries;
u32 rq_bytes_sent;
unsigned long rq_xtime;
int rq_ntrans;
};
#define rq_svec rq_snd_buf.head
#define rq_slen rq_snd_buf.len
struct rpc_xprt_ops {
void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
int (*reserve_xprt)(struct rpc_task *task);
void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
void (*connect)(struct rpc_task *task);
void * (*buf_alloc)(struct rpc_task *task, size_t size);
void (*buf_free)(struct rpc_task *task);
int (*send_request)(struct rpc_task *task);
void (*set_retrans_timeout)(struct rpc_task *task);
void (*timer)(struct rpc_task *task);
void (*release_request)(struct rpc_task *task);
void (*close)(struct rpc_xprt *xprt);
void (*destroy)(struct rpc_xprt *xprt);
void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq);
};
struct rpc_xprt {
struct rpc_xprt_ops * ops;
struct socket * sock;
struct sock * inet;
struct rpc_timeout timeout;
struct sockaddr_in addr;
int prot;
unsigned long cong;
unsigned long cwnd;
size_t rcvsize,
sndsize;
size_t max_payload;
unsigned int tsh_size;
struct rpc_wait_queue sending;
struct rpc_wait_queue resend;
struct rpc_wait_queue pending;
struct rpc_wait_queue backlog;
struct list_head free;
struct rpc_rqst * slot;
unsigned int max_reqs;
unsigned long state;
unsigned char shutdown : 1,
resvport : 1;
__u32 xid;
u32 tcp_recm,
tcp_xid,
tcp_reclen,
tcp_offset;
unsigned long tcp_copied,
tcp_flags;
unsigned long connect_timeout,
bind_timeout,
reestablish_timeout;
struct work_struct connect_worker;
unsigned short port;
struct work_struct task_cleanup;
struct timer_list timer;
unsigned long last_used,
idle_timeout;
spinlock_t transport_lock;
spinlock_t reserve_lock;
struct rpc_task * snd_task;
struct list_head recv;
struct {
unsigned long bind_count,
connect_count,
connect_start,
connect_time,
sends,
recvs,
bad_xids;
unsigned long long req_u,
bklog_u;
} stat;
void (*old_data_ready)(struct sock *, int);
void (*old_state_change)(struct sock *);
void (*old_write_space)(struct sock *);
};
#define XPRT_LAST_FRAG (1 << 0)
#define XPRT_COPY_RECM (1 << 1)
#define XPRT_COPY_XID (1 << 2)
#define XPRT_COPY_DATA (1 << 3)
#endif
|