File Index
Files and directories
Sign in
FILE

nfs4xdr_gen.c

File preview with syntax highlighting.

linux-6.19.14/fs/nfsd/nfs4xdr_gen.c C
  1// SPDX-License-Identifier: GPL-2.0
  2// Generated by xdrgen. Manual edits will be lost.
  3// XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x
  4// XDR specification modification time: Mon Oct 14 09:10:13 2024
  5
  6#include <linux/sunrpc/svc.h>
  7
  8#include "nfs4xdr_gen.h"
  9
 10static bool __maybe_unused
 11xdrgen_decode_int64_t(struct xdr_stream *xdr, int64_t *ptr)
 12{
 13	return xdrgen_decode_hyper(xdr, ptr);
 14};
 15
 16static bool __maybe_unused
 17xdrgen_decode_uint32_t(struct xdr_stream *xdr, uint32_t *ptr)
 18{
 19	return xdrgen_decode_unsigned_int(xdr, ptr);
 20};
 21
 22static bool __maybe_unused
 23xdrgen_decode_bitmap4(struct xdr_stream *xdr, bitmap4 *ptr)
 24{
 25	if (xdr_stream_decode_u32(xdr, &ptr->count) < 0)
 26		return false;
 27	for (u32 i = 0; i < ptr->count; i++)
 28		if (!xdrgen_decode_uint32_t(xdr, &ptr->element[i]))
 29			return false;
 30	return true;
 31};
 32
 33static bool __maybe_unused
 34xdrgen_decode_nfstime4(struct xdr_stream *xdr, struct nfstime4 *ptr)
 35{
 36	if (!xdrgen_decode_int64_t(xdr, &ptr->seconds))
 37		return false;
 38	if (!xdrgen_decode_uint32_t(xdr, &ptr->nseconds))
 39		return false;
 40	return true;
 41};
 42
 43static bool __maybe_unused
 44xdrgen_decode_fattr4_offline(struct xdr_stream *xdr, fattr4_offline *ptr)
 45{
 46	return xdrgen_decode_bool(xdr, ptr);
 47};
 48
 49static bool __maybe_unused
 50xdrgen_decode_open_arguments4(struct xdr_stream *xdr, struct open_arguments4 *ptr)
 51{
 52	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access))
 53		return false;
 54	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_deny))
 55		return false;
 56	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access_want))
 57		return false;
 58	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_open_claim))
 59		return false;
 60	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_create_mode))
 61		return false;
 62	return true;
 63};
 64
 65static bool __maybe_unused
 66xdrgen_decode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 *ptr)
 67{
 68	u32 val;
 69
 70	if (xdr_stream_decode_u32(xdr, &val) < 0)
 71		return false;
 72	*ptr = val;
 73	return true;
 74}
 75
 76static bool __maybe_unused
 77xdrgen_decode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 *ptr)
 78{
 79	u32 val;
 80
 81	if (xdr_stream_decode_u32(xdr, &val) < 0)
 82		return false;
 83	*ptr = val;
 84	return true;
 85}
 86
 87static bool __maybe_unused
 88xdrgen_decode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 *ptr)
 89{
 90	u32 val;
 91
 92	if (xdr_stream_decode_u32(xdr, &val) < 0)
 93		return false;
 94	*ptr = val;
 95	return true;
 96}
 97
 98static bool __maybe_unused
 99xdrgen_decode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 *ptr)
100{
101	u32 val;
102
103	if (xdr_stream_decode_u32(xdr, &val) < 0)
104		return false;
105	*ptr = val;
106	return true;
107}
108
109static bool __maybe_unused
110xdrgen_decode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 *ptr)
111{
112	u32 val;
113
114	if (xdr_stream_decode_u32(xdr, &val) < 0)
115		return false;
116	*ptr = val;
117	return true;
118}
119
120bool
121xdrgen_decode_fattr4_open_arguments(struct xdr_stream *xdr, fattr4_open_arguments *ptr)
122{
123	return xdrgen_decode_open_arguments4(xdr, ptr);
124};
125
126bool
127xdrgen_decode_fattr4_time_deleg_access(struct xdr_stream *xdr, fattr4_time_deleg_access *ptr)
128{
129	return xdrgen_decode_nfstime4(xdr, ptr);
130};
131
132bool
133xdrgen_decode_fattr4_time_deleg_modify(struct xdr_stream *xdr, fattr4_time_deleg_modify *ptr)
134{
135	return xdrgen_decode_nfstime4(xdr, ptr);
136};
137
138static bool __maybe_unused
139xdrgen_decode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 *ptr)
140{
141	u32 val;
142
143	if (xdr_stream_decode_u32(xdr, &val) < 0)
144		return false;
145	*ptr = val;
146	return true;
147}
148
149static bool __maybe_unused
150xdrgen_encode_int64_t(struct xdr_stream *xdr, const int64_t value)
151{
152	return xdrgen_encode_hyper(xdr, value);
153};
154
155static bool __maybe_unused
156xdrgen_encode_uint32_t(struct xdr_stream *xdr, const uint32_t value)
157{
158	return xdrgen_encode_unsigned_int(xdr, value);
159};
160
161static bool __maybe_unused
162xdrgen_encode_bitmap4(struct xdr_stream *xdr, const bitmap4 value)
163{
164	if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT)
165		return false;
166	for (u32 i = 0; i < value.count; i++)
167		if (!xdrgen_encode_uint32_t(xdr, value.element[i]))
168			return false;
169	return true;
170};
171
172static bool __maybe_unused
173xdrgen_encode_nfstime4(struct xdr_stream *xdr, const struct nfstime4 *value)
174{
175	if (!xdrgen_encode_int64_t(xdr, value->seconds))
176		return false;
177	if (!xdrgen_encode_uint32_t(xdr, value->nseconds))
178		return false;
179	return true;
180};
181
182static bool __maybe_unused
183xdrgen_encode_fattr4_offline(struct xdr_stream *xdr, const fattr4_offline value)
184{
185	return xdrgen_encode_bool(xdr, value);
186};
187
188static bool __maybe_unused
189xdrgen_encode_open_arguments4(struct xdr_stream *xdr, const struct open_arguments4 *value)
190{
191	if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access))
192		return false;
193	if (!xdrgen_encode_bitmap4(xdr, value->oa_share_deny))
194		return false;
195	if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access_want))
196		return false;
197	if (!xdrgen_encode_bitmap4(xdr, value->oa_open_claim))
198		return false;
199	if (!xdrgen_encode_bitmap4(xdr, value->oa_create_mode))
200		return false;
201	return true;
202};
203
204static bool __maybe_unused
205xdrgen_encode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 value)
206{
207	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
208}
209
210static bool __maybe_unused
211xdrgen_encode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 value)
212{
213	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
214}
215
216static bool __maybe_unused
217xdrgen_encode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 value)
218{
219	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
220}
221
222static bool __maybe_unused
223xdrgen_encode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 value)
224{
225	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
226}
227
228static bool __maybe_unused
229xdrgen_encode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 value)
230{
231	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
232}
233
234bool
235xdrgen_encode_fattr4_open_arguments(struct xdr_stream *xdr, const fattr4_open_arguments *value)
236{
237	return xdrgen_encode_open_arguments4(xdr, value);
238};
239
240bool
241xdrgen_encode_fattr4_time_deleg_access(struct xdr_stream *xdr, const fattr4_time_deleg_access *value)
242{
243	return xdrgen_encode_nfstime4(xdr, value);
244};
245
246bool
247xdrgen_encode_fattr4_time_deleg_modify(struct xdr_stream *xdr, const fattr4_time_deleg_modify *value)
248{
249	return xdrgen_encode_nfstime4(xdr, value);
250};
251
252static bool __maybe_unused
253xdrgen_encode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 value)
254{
255	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
256}
~/ Read-only file preview.