xref: /linux/fs/nfsd/nfs4xdr_gen.c (revision 1260ed77798502de9c98020040d2995008de10cc)
18e1d3227SJeff Layton // SPDX-License-Identifier: GPL-2.0
28e1d3227SJeff Layton // Generated by xdrgen. Manual edits will be lost.
38e1d3227SJeff Layton // XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x
4*c9c99a33SJeff Layton // XDR specification modification time: Mon Oct 14 09:10:13 2024
58e1d3227SJeff Layton 
68e1d3227SJeff Layton #include <linux/sunrpc/svc.h>
78e1d3227SJeff Layton 
88e1d3227SJeff Layton #include "nfs4xdr_gen.h"
98e1d3227SJeff Layton 
108e1d3227SJeff Layton static bool __maybe_unused
118e1d3227SJeff Layton xdrgen_decode_int64_t(struct xdr_stream *xdr, int64_t *ptr)
128e1d3227SJeff Layton {
138e1d3227SJeff Layton 	return xdrgen_decode_hyper(xdr, ptr);
148e1d3227SJeff Layton };
158e1d3227SJeff Layton 
168e1d3227SJeff Layton static bool __maybe_unused
178e1d3227SJeff Layton xdrgen_decode_uint32_t(struct xdr_stream *xdr, uint32_t *ptr)
188e1d3227SJeff Layton {
198e1d3227SJeff Layton 	return xdrgen_decode_unsigned_int(xdr, ptr);
208e1d3227SJeff Layton };
218e1d3227SJeff Layton 
228e1d3227SJeff Layton static bool __maybe_unused
238e1d3227SJeff Layton xdrgen_decode_bitmap4(struct xdr_stream *xdr, bitmap4 *ptr)
248e1d3227SJeff Layton {
258e1d3227SJeff Layton 	if (xdr_stream_decode_u32(xdr, &ptr->count) < 0)
268e1d3227SJeff Layton 		return false;
278e1d3227SJeff Layton 	for (u32 i = 0; i < ptr->count; i++)
288e1d3227SJeff Layton 		if (!xdrgen_decode_uint32_t(xdr, &ptr->element[i]))
298e1d3227SJeff Layton 			return false;
308e1d3227SJeff Layton 	return true;
318e1d3227SJeff Layton };
328e1d3227SJeff Layton 
338e1d3227SJeff Layton static bool __maybe_unused
348e1d3227SJeff Layton xdrgen_decode_nfstime4(struct xdr_stream *xdr, struct nfstime4 *ptr)
358e1d3227SJeff Layton {
368e1d3227SJeff Layton 	if (!xdrgen_decode_int64_t(xdr, &ptr->seconds))
378e1d3227SJeff Layton 		return false;
388e1d3227SJeff Layton 	if (!xdrgen_decode_uint32_t(xdr, &ptr->nseconds))
398e1d3227SJeff Layton 		return false;
408e1d3227SJeff Layton 	return true;
418e1d3227SJeff Layton };
428e1d3227SJeff Layton 
438e1d3227SJeff Layton static bool __maybe_unused
448e1d3227SJeff Layton xdrgen_decode_fattr4_offline(struct xdr_stream *xdr, fattr4_offline *ptr)
458e1d3227SJeff Layton {
468e1d3227SJeff Layton 	return xdrgen_decode_bool(xdr, ptr);
478e1d3227SJeff Layton };
488e1d3227SJeff Layton 
498e1d3227SJeff Layton static bool __maybe_unused
508e1d3227SJeff Layton xdrgen_decode_open_arguments4(struct xdr_stream *xdr, struct open_arguments4 *ptr)
518e1d3227SJeff Layton {
528e1d3227SJeff Layton 	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access))
538e1d3227SJeff Layton 		return false;
548e1d3227SJeff Layton 	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_deny))
558e1d3227SJeff Layton 		return false;
568e1d3227SJeff Layton 	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access_want))
578e1d3227SJeff Layton 		return false;
588e1d3227SJeff Layton 	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_open_claim))
598e1d3227SJeff Layton 		return false;
608e1d3227SJeff Layton 	if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_create_mode))
618e1d3227SJeff Layton 		return false;
628e1d3227SJeff Layton 	return true;
638e1d3227SJeff Layton };
648e1d3227SJeff Layton 
658e1d3227SJeff Layton static bool __maybe_unused
668e1d3227SJeff Layton xdrgen_decode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 *ptr)
678e1d3227SJeff Layton {
688e1d3227SJeff Layton 	u32 val;
698e1d3227SJeff Layton 
708e1d3227SJeff Layton 	if (xdr_stream_decode_u32(xdr, &val) < 0)
718e1d3227SJeff Layton 		return false;
728e1d3227SJeff Layton 	*ptr = val;
738e1d3227SJeff Layton 	return true;
748e1d3227SJeff Layton }
758e1d3227SJeff Layton 
768e1d3227SJeff Layton static bool __maybe_unused
778e1d3227SJeff Layton xdrgen_decode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 *ptr)
788e1d3227SJeff Layton {
798e1d3227SJeff Layton 	u32 val;
808e1d3227SJeff Layton 
818e1d3227SJeff Layton 	if (xdr_stream_decode_u32(xdr, &val) < 0)
828e1d3227SJeff Layton 		return false;
838e1d3227SJeff Layton 	*ptr = val;
848e1d3227SJeff Layton 	return true;
858e1d3227SJeff Layton }
868e1d3227SJeff Layton 
878e1d3227SJeff Layton static bool __maybe_unused
888e1d3227SJeff Layton xdrgen_decode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 *ptr)
898e1d3227SJeff Layton {
908e1d3227SJeff Layton 	u32 val;
918e1d3227SJeff Layton 
928e1d3227SJeff Layton 	if (xdr_stream_decode_u32(xdr, &val) < 0)
938e1d3227SJeff Layton 		return false;
948e1d3227SJeff Layton 	*ptr = val;
958e1d3227SJeff Layton 	return true;
968e1d3227SJeff Layton }
978e1d3227SJeff Layton 
988e1d3227SJeff Layton static bool __maybe_unused
998e1d3227SJeff Layton xdrgen_decode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 *ptr)
1008e1d3227SJeff Layton {
1018e1d3227SJeff Layton 	u32 val;
1028e1d3227SJeff Layton 
1038e1d3227SJeff Layton 	if (xdr_stream_decode_u32(xdr, &val) < 0)
1048e1d3227SJeff Layton 		return false;
1058e1d3227SJeff Layton 	*ptr = val;
1068e1d3227SJeff Layton 	return true;
1078e1d3227SJeff Layton }
1088e1d3227SJeff Layton 
1098e1d3227SJeff Layton static bool __maybe_unused
1108e1d3227SJeff Layton xdrgen_decode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 *ptr)
1118e1d3227SJeff Layton {
1128e1d3227SJeff Layton 	u32 val;
1138e1d3227SJeff Layton 
1148e1d3227SJeff Layton 	if (xdr_stream_decode_u32(xdr, &val) < 0)
1158e1d3227SJeff Layton 		return false;
1168e1d3227SJeff Layton 	*ptr = val;
1178e1d3227SJeff Layton 	return true;
1188e1d3227SJeff Layton }
1198e1d3227SJeff Layton 
1208e1d3227SJeff Layton bool
1218e1d3227SJeff Layton xdrgen_decode_fattr4_open_arguments(struct xdr_stream *xdr, fattr4_open_arguments *ptr)
1228e1d3227SJeff Layton {
1238e1d3227SJeff Layton 	return xdrgen_decode_open_arguments4(xdr, ptr);
1248e1d3227SJeff Layton };
1258e1d3227SJeff Layton 
1268e1d3227SJeff Layton bool
1278e1d3227SJeff Layton xdrgen_decode_fattr4_time_deleg_access(struct xdr_stream *xdr, fattr4_time_deleg_access *ptr)
1288e1d3227SJeff Layton {
1298e1d3227SJeff Layton 	return xdrgen_decode_nfstime4(xdr, ptr);
1308e1d3227SJeff Layton };
1318e1d3227SJeff Layton 
1328e1d3227SJeff Layton bool
1338e1d3227SJeff Layton xdrgen_decode_fattr4_time_deleg_modify(struct xdr_stream *xdr, fattr4_time_deleg_modify *ptr)
1348e1d3227SJeff Layton {
1358e1d3227SJeff Layton 	return xdrgen_decode_nfstime4(xdr, ptr);
1368e1d3227SJeff Layton };
1378e1d3227SJeff Layton 
1388e1d3227SJeff Layton static bool __maybe_unused
1398dfbea8bSJeff Layton xdrgen_decode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 *ptr)
1408dfbea8bSJeff Layton {
1418dfbea8bSJeff Layton 	u32 val;
1428dfbea8bSJeff Layton 
1438dfbea8bSJeff Layton 	if (xdr_stream_decode_u32(xdr, &val) < 0)
1448dfbea8bSJeff Layton 		return false;
1458dfbea8bSJeff Layton 	*ptr = val;
1468dfbea8bSJeff Layton 	return true;
1478dfbea8bSJeff Layton }
1488dfbea8bSJeff Layton 
1498dfbea8bSJeff Layton static bool __maybe_unused
1508e1d3227SJeff Layton xdrgen_encode_int64_t(struct xdr_stream *xdr, const int64_t value)
1518e1d3227SJeff Layton {
1528e1d3227SJeff Layton 	return xdrgen_encode_hyper(xdr, value);
1538e1d3227SJeff Layton };
1548e1d3227SJeff Layton 
1558e1d3227SJeff Layton static bool __maybe_unused
1568e1d3227SJeff Layton xdrgen_encode_uint32_t(struct xdr_stream *xdr, const uint32_t value)
1578e1d3227SJeff Layton {
1588e1d3227SJeff Layton 	return xdrgen_encode_unsigned_int(xdr, value);
1598e1d3227SJeff Layton };
1608e1d3227SJeff Layton 
1618e1d3227SJeff Layton static bool __maybe_unused
1628e1d3227SJeff Layton xdrgen_encode_bitmap4(struct xdr_stream *xdr, const bitmap4 value)
1638e1d3227SJeff Layton {
1648e1d3227SJeff Layton 	if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT)
1658e1d3227SJeff Layton 		return false;
1668e1d3227SJeff Layton 	for (u32 i = 0; i < value.count; i++)
1678e1d3227SJeff Layton 		if (!xdrgen_encode_uint32_t(xdr, value.element[i]))
1688e1d3227SJeff Layton 			return false;
1698e1d3227SJeff Layton 	return true;
1708e1d3227SJeff Layton };
1718e1d3227SJeff Layton 
1728e1d3227SJeff Layton static bool __maybe_unused
1738e1d3227SJeff Layton xdrgen_encode_nfstime4(struct xdr_stream *xdr, const struct nfstime4 *value)
1748e1d3227SJeff Layton {
1758e1d3227SJeff Layton 	if (!xdrgen_encode_int64_t(xdr, value->seconds))
1768e1d3227SJeff Layton 		return false;
1778e1d3227SJeff Layton 	if (!xdrgen_encode_uint32_t(xdr, value->nseconds))
1788e1d3227SJeff Layton 		return false;
1798e1d3227SJeff Layton 	return true;
1808e1d3227SJeff Layton };
1818e1d3227SJeff Layton 
1828e1d3227SJeff Layton static bool __maybe_unused
1838e1d3227SJeff Layton xdrgen_encode_fattr4_offline(struct xdr_stream *xdr, const fattr4_offline value)
1848e1d3227SJeff Layton {
1858e1d3227SJeff Layton 	return xdrgen_encode_bool(xdr, value);
1868e1d3227SJeff Layton };
1878e1d3227SJeff Layton 
1888e1d3227SJeff Layton static bool __maybe_unused
1898e1d3227SJeff Layton xdrgen_encode_open_arguments4(struct xdr_stream *xdr, const struct open_arguments4 *value)
1908e1d3227SJeff Layton {
1918e1d3227SJeff Layton 	if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access))
1928e1d3227SJeff Layton 		return false;
1938e1d3227SJeff Layton 	if (!xdrgen_encode_bitmap4(xdr, value->oa_share_deny))
1948e1d3227SJeff Layton 		return false;
1958e1d3227SJeff Layton 	if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access_want))
1968e1d3227SJeff Layton 		return false;
1978e1d3227SJeff Layton 	if (!xdrgen_encode_bitmap4(xdr, value->oa_open_claim))
1988e1d3227SJeff Layton 		return false;
1998e1d3227SJeff Layton 	if (!xdrgen_encode_bitmap4(xdr, value->oa_create_mode))
2008e1d3227SJeff Layton 		return false;
2018e1d3227SJeff Layton 	return true;
2028e1d3227SJeff Layton };
2038e1d3227SJeff Layton 
2048e1d3227SJeff Layton static bool __maybe_unused
2058e1d3227SJeff Layton xdrgen_encode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 value)
2068e1d3227SJeff Layton {
2078e1d3227SJeff Layton 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
2088e1d3227SJeff Layton }
2098e1d3227SJeff Layton 
2108e1d3227SJeff Layton static bool __maybe_unused
2118e1d3227SJeff Layton xdrgen_encode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 value)
2128e1d3227SJeff Layton {
2138e1d3227SJeff Layton 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
2148e1d3227SJeff Layton }
2158e1d3227SJeff Layton 
2168e1d3227SJeff Layton static bool __maybe_unused
2178e1d3227SJeff Layton xdrgen_encode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 value)
2188e1d3227SJeff Layton {
2198e1d3227SJeff Layton 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
2208e1d3227SJeff Layton }
2218e1d3227SJeff Layton 
2228e1d3227SJeff Layton static bool __maybe_unused
2238e1d3227SJeff Layton xdrgen_encode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 value)
2248e1d3227SJeff Layton {
2258e1d3227SJeff Layton 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
2268e1d3227SJeff Layton }
2278e1d3227SJeff Layton 
2288e1d3227SJeff Layton static bool __maybe_unused
2298e1d3227SJeff Layton xdrgen_encode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 value)
2308e1d3227SJeff Layton {
2318e1d3227SJeff Layton 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
2328e1d3227SJeff Layton }
2338e1d3227SJeff Layton 
2348e1d3227SJeff Layton bool
2358e1d3227SJeff Layton xdrgen_encode_fattr4_open_arguments(struct xdr_stream *xdr, const fattr4_open_arguments *value)
2368e1d3227SJeff Layton {
2378e1d3227SJeff Layton 	return xdrgen_encode_open_arguments4(xdr, value);
2388e1d3227SJeff Layton };
2398e1d3227SJeff Layton 
2408e1d3227SJeff Layton bool
2418e1d3227SJeff Layton xdrgen_encode_fattr4_time_deleg_access(struct xdr_stream *xdr, const fattr4_time_deleg_access *value)
2428e1d3227SJeff Layton {
2438e1d3227SJeff Layton 	return xdrgen_encode_nfstime4(xdr, value);
2448e1d3227SJeff Layton };
2458e1d3227SJeff Layton 
2468e1d3227SJeff Layton bool
2478e1d3227SJeff Layton xdrgen_encode_fattr4_time_deleg_modify(struct xdr_stream *xdr, const fattr4_time_deleg_modify *value)
2488e1d3227SJeff Layton {
2498e1d3227SJeff Layton 	return xdrgen_encode_nfstime4(xdr, value);
2508e1d3227SJeff Layton };
2518dfbea8bSJeff Layton 
2528dfbea8bSJeff Layton static bool __maybe_unused
2538dfbea8bSJeff Layton xdrgen_encode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 value)
2548dfbea8bSJeff Layton {
2558dfbea8bSJeff Layton 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
2568dfbea8bSJeff Layton }
257