summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc/xdrgen/nlm4.h
blob: e95e8f105624d8f050ee2b85a275928d4c2f5dad (plain)
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
/* SPDX-License-Identifier: GPL-2.0 */
/* Generated by xdrgen. Manual edits will be lost. */
/* XDR specification file: ../../Documentation/sunrpc/xdr/nlm4.x */
/* XDR specification modification time: Thu Dec 25 13:10:19 2025 */

#ifndef _LINUX_XDRGEN_NLM4_DEF_H
#define _LINUX_XDRGEN_NLM4_DEF_H

#include <linux/types.h>
#include <linux/sunrpc/xdrgen/_defs.h>

enum { LM_MAXSTRLEN = 1024 };

enum { LM_MAXNAMELEN = 1025 };

enum { MAXNETOBJ_SZ = 1024 };

typedef opaque netobj;

enum fsh4_mode {
	fsm_DN = 0,
	fsm_DR = 1,
	fsm_DW = 2,
	fsm_DRW = 3,
};

typedef enum fsh4_mode fsh4_mode;

enum fsh4_access {
	fsa_NONE = 0,
	fsa_R = 1,
	fsa_W = 2,
	fsa_RW = 3,
};

typedef enum fsh4_access fsh4_access;

enum { SM_MAXSTRLEN = 1024 };

typedef u64 uint64;

typedef s64 int64;

typedef u32 uint32;

typedef s32 int32;

enum nlm4_stats {
	NLM4_GRANTED = 0,
	NLM4_DENIED = 1,
	NLM4_DENIED_NOLOCKS = 2,
	NLM4_BLOCKED = 3,
	NLM4_DENIED_GRACE_PERIOD = 4,
	NLM4_DEADLCK = 5,
	NLM4_ROFS = 6,
	NLM4_STALE_FH = 7,
	NLM4_FBIG = 8,
	NLM4_FAILED = 9,
};

typedef __be32 nlm4_stats;

struct nlm4_holder {
	bool exclusive;
	int32 svid;
	netobj oh;
	uint64 l_offset;
	uint64 l_len;
};

struct nlm4_testrply {
	nlm4_stats stat;
	union {
		struct nlm4_holder holder;
	} u;
};

struct nlm4_stat {
	nlm4_stats stat;
};

struct nlm4_res {
	netobj cookie;
	struct nlm4_stat stat;
};

struct nlm4_testres {
	netobj cookie;
	struct nlm4_testrply stat;
};

struct nlm4_lock {
	string caller_name;
	netobj fh;
	netobj oh;
	int32 svid;
	uint64 l_offset;
	uint64 l_len;
};

struct nlm4_lockargs {
	netobj cookie;
	bool block;
	bool exclusive;
	struct nlm4_lock alock;
	bool reclaim;
	int32 state;
};

struct nlm4_cancargs {
	netobj cookie;
	bool block;
	bool exclusive;
	struct nlm4_lock alock;
};

struct nlm4_testargs {
	netobj cookie;
	bool exclusive;
	struct nlm4_lock alock;
};

struct nlm4_unlockargs {
	netobj cookie;
	struct nlm4_lock alock;
};

struct nlm4_share {
	string caller_name;
	netobj fh;
	netobj oh;
	fsh4_mode mode;
	fsh4_access access;
};

struct nlm4_shareargs {
	netobj cookie;
	struct nlm4_share share;
	bool reclaim;
};

struct nlm4_shareres {
	netobj cookie;
	nlm4_stats stat;
	int32 sequence;
};

struct nlm4_notify {
	string name;
	int32 state;
};

enum { SM_PRIV_SIZE = 16 };

struct nlm4_notifyargs {
	struct nlm4_notify notify;
	u8 private[SM_PRIV_SIZE];
};

enum {
	NLMPROC4_NULL = 0,
	NLMPROC4_TEST = 1,
	NLMPROC4_LOCK = 2,
	NLMPROC4_CANCEL = 3,
	NLMPROC4_UNLOCK = 4,
	NLMPROC4_GRANTED = 5,
	NLMPROC4_TEST_MSG = 6,
	NLMPROC4_LOCK_MSG = 7,
	NLMPROC4_CANCEL_MSG = 8,
	NLMPROC4_UNLOCK_MSG = 9,
	NLMPROC4_GRANTED_MSG = 10,
	NLMPROC4_TEST_RES = 11,
	NLMPROC4_LOCK_RES = 12,
	NLMPROC4_CANCEL_RES = 13,
	NLMPROC4_UNLOCK_RES = 14,
	NLMPROC4_GRANTED_RES = 15,
	NLMPROC4_SM_NOTIFY = 16,
	NLMPROC4_SHARE = 20,
	NLMPROC4_UNSHARE = 21,
	NLMPROC4_NM_LOCK = 22,
	NLMPROC4_FREE_ALL = 23,
};

#ifndef NLM4_PROG
#define NLM4_PROG (100021)
#endif

#define NLM4_netobj_sz                  (XDR_unsigned_int + XDR_QUADLEN(MAXNETOBJ_SZ))
#define NLM4_fsh4_mode_sz               (XDR_int)
#define NLM4_fsh4_access_sz             (XDR_int)
#define NLM4_uint64_sz                  \
	(XDR_unsigned_hyper)
#define NLM4_int64_sz                   \
	(XDR_hyper)
#define NLM4_uint32_sz                  \
	(XDR_unsigned_long)
#define NLM4_int32_sz                   \
	(XDR_long)
#define NLM4_nlm4_stats_sz              (XDR_int)
#define NLM4_nlm4_holder_sz             \
	(XDR_bool + NLM4_int32_sz + NLM4_netobj_sz + NLM4_uint64_sz + NLM4_uint64_sz)
#define NLM4_nlm4_testrply_sz           \
	(NLM4_nlm4_stats_sz + NLM4_nlm4_holder_sz)
#define NLM4_nlm4_stat_sz               \
	(NLM4_nlm4_stats_sz)
#define NLM4_nlm4_res_sz                \
	(NLM4_netobj_sz + NLM4_nlm4_stat_sz)
#define NLM4_nlm4_testres_sz            \
	(NLM4_netobj_sz + NLM4_nlm4_testrply_sz)
#define NLM4_nlm4_lock_sz               \
	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXSTRLEN) + NLM4_netobj_sz + NLM4_netobj_sz + NLM4_int32_sz + NLM4_uint64_sz + NLM4_uint64_sz)
#define NLM4_nlm4_lockargs_sz           \
	(NLM4_netobj_sz + XDR_bool + XDR_bool + NLM4_nlm4_lock_sz + XDR_bool + NLM4_int32_sz)
#define NLM4_nlm4_cancargs_sz           \
	(NLM4_netobj_sz + XDR_bool + XDR_bool + NLM4_nlm4_lock_sz)
#define NLM4_nlm4_testargs_sz           \
	(NLM4_netobj_sz + XDR_bool + NLM4_nlm4_lock_sz)
#define NLM4_nlm4_unlockargs_sz         \
	(NLM4_netobj_sz + NLM4_nlm4_lock_sz)
#define NLM4_nlm4_share_sz              \
	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXSTRLEN) + NLM4_netobj_sz + NLM4_netobj_sz + NLM4_fsh4_mode_sz + NLM4_fsh4_access_sz)
#define NLM4_nlm4_shareargs_sz          \
	(NLM4_netobj_sz + NLM4_nlm4_share_sz + XDR_bool)
#define NLM4_nlm4_shareres_sz           \
	(NLM4_netobj_sz + NLM4_nlm4_stats_sz + NLM4_int32_sz)
#define NLM4_nlm4_notify_sz             \
	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXNAMELEN) + NLM4_int32_sz)
#define NLM4_nlm4_notifyargs_sz         \
	(NLM4_nlm4_notify_sz + XDR_QUADLEN(SM_PRIV_SIZE))
#define NLM4_MAX_ARGS_SZ                \
	(NLM4_nlm4_lockargs_sz)

#endif /* _LINUX_XDRGEN_NLM4_DEF_H */