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
6 #include <linux/sunrpc/svc.h>
8 #include "nfs4xdr_gen.h"
10 static bool __maybe_unused
11 xdrgen_decode_int64_t(struct xdr_stream
*xdr
, int64_t *ptr
)
13 return xdrgen_decode_hyper(xdr
, ptr
);
16 static bool __maybe_unused
17 xdrgen_decode_uint32_t(struct xdr_stream
*xdr
, uint32_t *ptr
)
19 return xdrgen_decode_unsigned_int(xdr
, ptr
);
22 static bool __maybe_unused
23 xdrgen_decode_bitmap4(struct xdr_stream
*xdr
, bitmap4
*ptr
)
25 if (xdr_stream_decode_u32(xdr
, &ptr
->count
) < 0)
27 for (u32 i
= 0; i
< ptr
->count
; i
++)
28 if (!xdrgen_decode_uint32_t(xdr
, &ptr
->element
[i
]))
33 static bool __maybe_unused
34 xdrgen_decode_nfstime4(struct xdr_stream
*xdr
, struct nfstime4
*ptr
)
36 if (!xdrgen_decode_int64_t(xdr
, &ptr
->seconds
))
38 if (!xdrgen_decode_uint32_t(xdr
, &ptr
->nseconds
))
43 static bool __maybe_unused
44 xdrgen_decode_fattr4_offline(struct xdr_stream
*xdr
, fattr4_offline
*ptr
)
46 return xdrgen_decode_bool(xdr
, ptr
);
49 static bool __maybe_unused
50 xdrgen_decode_open_arguments4(struct xdr_stream
*xdr
, struct open_arguments4
*ptr
)
52 if (!xdrgen_decode_bitmap4(xdr
, &ptr
->oa_share_access
))
54 if (!xdrgen_decode_bitmap4(xdr
, &ptr
->oa_share_deny
))
56 if (!xdrgen_decode_bitmap4(xdr
, &ptr
->oa_share_access_want
))
58 if (!xdrgen_decode_bitmap4(xdr
, &ptr
->oa_open_claim
))
60 if (!xdrgen_decode_bitmap4(xdr
, &ptr
->oa_create_mode
))
65 static bool __maybe_unused
66 xdrgen_decode_open_args_share_access4(struct xdr_stream
*xdr
, open_args_share_access4
*ptr
)
70 if (xdr_stream_decode_u32(xdr
, &val
) < 0)
76 static bool __maybe_unused
77 xdrgen_decode_open_args_share_deny4(struct xdr_stream
*xdr
, open_args_share_deny4
*ptr
)
81 if (xdr_stream_decode_u32(xdr
, &val
) < 0)
87 static bool __maybe_unused
88 xdrgen_decode_open_args_share_access_want4(struct xdr_stream
*xdr
, open_args_share_access_want4
*ptr
)
92 if (xdr_stream_decode_u32(xdr
, &val
) < 0)
98 static bool __maybe_unused
99 xdrgen_decode_open_args_open_claim4(struct xdr_stream
*xdr
, open_args_open_claim4
*ptr
)
103 if (xdr_stream_decode_u32(xdr
, &val
) < 0)
109 static bool __maybe_unused
110 xdrgen_decode_open_args_createmode4(struct xdr_stream
*xdr
, open_args_createmode4
*ptr
)
114 if (xdr_stream_decode_u32(xdr
, &val
) < 0)
121 xdrgen_decode_fattr4_open_arguments(struct xdr_stream
*xdr
, fattr4_open_arguments
*ptr
)
123 return xdrgen_decode_open_arguments4(xdr
, ptr
);
127 xdrgen_decode_fattr4_time_deleg_access(struct xdr_stream
*xdr
, fattr4_time_deleg_access
*ptr
)
129 return xdrgen_decode_nfstime4(xdr
, ptr
);
133 xdrgen_decode_fattr4_time_deleg_modify(struct xdr_stream
*xdr
, fattr4_time_deleg_modify
*ptr
)
135 return xdrgen_decode_nfstime4(xdr
, ptr
);
138 static bool __maybe_unused
139 xdrgen_decode_open_delegation_type4(struct xdr_stream
*xdr
, open_delegation_type4
*ptr
)
143 if (xdr_stream_decode_u32(xdr
, &val
) < 0)
149 static bool __maybe_unused
150 xdrgen_encode_int64_t(struct xdr_stream
*xdr
, const int64_t value
)
152 return xdrgen_encode_hyper(xdr
, value
);
155 static bool __maybe_unused
156 xdrgen_encode_uint32_t(struct xdr_stream
*xdr
, const uint32_t value
)
158 return xdrgen_encode_unsigned_int(xdr
, value
);
161 static bool __maybe_unused
162 xdrgen_encode_bitmap4(struct xdr_stream
*xdr
, const bitmap4 value
)
164 if (xdr_stream_encode_u32(xdr
, value
.count
) != XDR_UNIT
)
166 for (u32 i
= 0; i
< value
.count
; i
++)
167 if (!xdrgen_encode_uint32_t(xdr
, value
.element
[i
]))
172 static bool __maybe_unused
173 xdrgen_encode_nfstime4(struct xdr_stream
*xdr
, const struct nfstime4
*value
)
175 if (!xdrgen_encode_int64_t(xdr
, value
->seconds
))
177 if (!xdrgen_encode_uint32_t(xdr
, value
->nseconds
))
182 static bool __maybe_unused
183 xdrgen_encode_fattr4_offline(struct xdr_stream
*xdr
, const fattr4_offline value
)
185 return xdrgen_encode_bool(xdr
, value
);
188 static bool __maybe_unused
189 xdrgen_encode_open_arguments4(struct xdr_stream
*xdr
, const struct open_arguments4
*value
)
191 if (!xdrgen_encode_bitmap4(xdr
, value
->oa_share_access
))
193 if (!xdrgen_encode_bitmap4(xdr
, value
->oa_share_deny
))
195 if (!xdrgen_encode_bitmap4(xdr
, value
->oa_share_access_want
))
197 if (!xdrgen_encode_bitmap4(xdr
, value
->oa_open_claim
))
199 if (!xdrgen_encode_bitmap4(xdr
, value
->oa_create_mode
))
204 static bool __maybe_unused
205 xdrgen_encode_open_args_share_access4(struct xdr_stream
*xdr
, open_args_share_access4 value
)
207 return xdr_stream_encode_u32(xdr
, value
) == XDR_UNIT
;
210 static bool __maybe_unused
211 xdrgen_encode_open_args_share_deny4(struct xdr_stream
*xdr
, open_args_share_deny4 value
)
213 return xdr_stream_encode_u32(xdr
, value
) == XDR_UNIT
;
216 static bool __maybe_unused
217 xdrgen_encode_open_args_share_access_want4(struct xdr_stream
*xdr
, open_args_share_access_want4 value
)
219 return xdr_stream_encode_u32(xdr
, value
) == XDR_UNIT
;
222 static bool __maybe_unused
223 xdrgen_encode_open_args_open_claim4(struct xdr_stream
*xdr
, open_args_open_claim4 value
)
225 return xdr_stream_encode_u32(xdr
, value
) == XDR_UNIT
;
228 static bool __maybe_unused
229 xdrgen_encode_open_args_createmode4(struct xdr_stream
*xdr
, open_args_createmode4 value
)
231 return xdr_stream_encode_u32(xdr
, value
) == XDR_UNIT
;
235 xdrgen_encode_fattr4_open_arguments(struct xdr_stream
*xdr
, const fattr4_open_arguments
*value
)
237 return xdrgen_encode_open_arguments4(xdr
, value
);
241 xdrgen_encode_fattr4_time_deleg_access(struct xdr_stream
*xdr
, const fattr4_time_deleg_access
*value
)
243 return xdrgen_encode_nfstime4(xdr
, value
);
247 xdrgen_encode_fattr4_time_deleg_modify(struct xdr_stream
*xdr
, const fattr4_time_deleg_modify
*value
)
249 return xdrgen_encode_nfstime4(xdr
, value
);
252 static bool __maybe_unused
253 xdrgen_encode_open_delegation_type4(struct xdr_stream
*xdr
, open_delegation_type4 value
)
255 return xdr_stream_encode_u32(xdr
, value
) == XDR_UNIT
;