| 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 | |
| 10 | static bool __maybe_unused |
| 11 | xdrgen_decode_int64_t(struct xdr_stream *xdr, int64_t *ptr) |
| 12 | { |
| 13 | return xdrgen_decode_hyper(xdr, ptr); |
| 14 | }; |
| 15 | |
| 16 | static bool __maybe_unused |
| 17 | xdrgen_decode_uint32_t(struct xdr_stream *xdr, uint32_t *ptr) |
| 18 | { |
| 19 | return xdrgen_decode_unsigned_int(xdr, ptr); |
| 20 | }; |
| 21 | |
| 22 | static bool __maybe_unused |
| 23 | xdrgen_decode_bitmap4(struct xdr_stream *xdr, bitmap4 *ptr) |
| 24 | { |
| 25 | if (xdr_stream_decode_u32(xdr, ptr: &ptr->count) < 0) |
| 26 | return false; |
| 27 | for (u32 i = 0; i < ptr->count; i++) |
| 28 | if (!xdrgen_decode_uint32_t(xdr, ptr: &ptr->element[i])) |
| 29 | return false; |
| 30 | return true; |
| 31 | }; |
| 32 | |
| 33 | static bool __maybe_unused |
| 34 | xdrgen_decode_nfstime4(struct xdr_stream *xdr, struct nfstime4 *ptr) |
| 35 | { |
| 36 | if (!xdrgen_decode_int64_t(xdr, ptr: &ptr->seconds)) |
| 37 | return false; |
| 38 | if (!xdrgen_decode_uint32_t(xdr, ptr: &ptr->nseconds)) |
| 39 | return false; |
| 40 | return true; |
| 41 | }; |
| 42 | |
| 43 | static bool __maybe_unused |
| 44 | xdrgen_decode_fattr4_offline(struct xdr_stream *xdr, fattr4_offline *ptr) |
| 45 | { |
| 46 | return xdrgen_decode_bool(xdr, ptr); |
| 47 | }; |
| 48 | |
| 49 | static bool __maybe_unused |
| 50 | xdrgen_decode_open_arguments4(struct xdr_stream *xdr, struct open_arguments4 *ptr) |
| 51 | { |
| 52 | if (!xdrgen_decode_bitmap4(xdr, ptr: &ptr->oa_share_access)) |
| 53 | return false; |
| 54 | if (!xdrgen_decode_bitmap4(xdr, ptr: &ptr->oa_share_deny)) |
| 55 | return false; |
| 56 | if (!xdrgen_decode_bitmap4(xdr, ptr: &ptr->oa_share_access_want)) |
| 57 | return false; |
| 58 | if (!xdrgen_decode_bitmap4(xdr, ptr: &ptr->oa_open_claim)) |
| 59 | return false; |
| 60 | if (!xdrgen_decode_bitmap4(xdr, ptr: &ptr->oa_create_mode)) |
| 61 | return false; |
| 62 | return true; |
| 63 | }; |
| 64 | |
| 65 | static bool __maybe_unused |
| 66 | xdrgen_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, ptr: &val) < 0) |
| 71 | return false; |
| 72 | *ptr = val; |
| 73 | return true; |
| 74 | } |
| 75 | |
| 76 | static bool __maybe_unused |
| 77 | xdrgen_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, ptr: &val) < 0) |
| 82 | return false; |
| 83 | *ptr = val; |
| 84 | return true; |
| 85 | } |
| 86 | |
| 87 | static bool __maybe_unused |
| 88 | xdrgen_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, ptr: &val) < 0) |
| 93 | return false; |
| 94 | *ptr = val; |
| 95 | return true; |
| 96 | } |
| 97 | |
| 98 | static bool __maybe_unused |
| 99 | xdrgen_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, ptr: &val) < 0) |
| 104 | return false; |
| 105 | *ptr = val; |
| 106 | return true; |
| 107 | } |
| 108 | |
| 109 | static bool __maybe_unused |
| 110 | xdrgen_decode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 *ptr) |
| 111 | { |
| 112 | u32 val; |
| 113 | |
| 114 | if (xdr_stream_decode_u32(xdr, ptr: &val) < 0) |
| 115 | return false; |
| 116 | *ptr = val; |
| 117 | return true; |
| 118 | } |
| 119 | |
| 120 | bool |
| 121 | xdrgen_decode_fattr4_open_arguments(struct xdr_stream *xdr, fattr4_open_arguments *ptr) |
| 122 | { |
| 123 | return xdrgen_decode_open_arguments4(xdr, ptr); |
| 124 | }; |
| 125 | |
| 126 | bool |
| 127 | xdrgen_decode_fattr4_time_deleg_access(struct xdr_stream *xdr, fattr4_time_deleg_access *ptr) |
| 128 | { |
| 129 | return xdrgen_decode_nfstime4(xdr, ptr); |
| 130 | }; |
| 131 | |
| 132 | bool |
| 133 | xdrgen_decode_fattr4_time_deleg_modify(struct xdr_stream *xdr, fattr4_time_deleg_modify *ptr) |
| 134 | { |
| 135 | return xdrgen_decode_nfstime4(xdr, ptr); |
| 136 | }; |
| 137 | |
| 138 | static bool __maybe_unused |
| 139 | xdrgen_decode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 *ptr) |
| 140 | { |
| 141 | u32 val; |
| 142 | |
| 143 | if (xdr_stream_decode_u32(xdr, ptr: &val) < 0) |
| 144 | return false; |
| 145 | *ptr = val; |
| 146 | return true; |
| 147 | } |
| 148 | |
| 149 | static bool __maybe_unused |
| 150 | xdrgen_encode_int64_t(struct xdr_stream *xdr, const int64_t value) |
| 151 | { |
| 152 | return xdrgen_encode_hyper(xdr, val: value); |
| 153 | }; |
| 154 | |
| 155 | static bool __maybe_unused |
| 156 | xdrgen_encode_uint32_t(struct xdr_stream *xdr, const uint32_t value) |
| 157 | { |
| 158 | return xdrgen_encode_unsigned_int(xdr, val: value); |
| 159 | }; |
| 160 | |
| 161 | static bool __maybe_unused |
| 162 | xdrgen_encode_bitmap4(struct xdr_stream *xdr, const bitmap4 value) |
| 163 | { |
| 164 | if (xdr_stream_encode_u32(xdr, n: value.count) != XDR_UNIT) |
| 165 | return false; |
| 166 | for (u32 i = 0; i < value.count; i++) |
| 167 | if (!xdrgen_encode_uint32_t(xdr, value: value.element[i])) |
| 168 | return false; |
| 169 | return true; |
| 170 | }; |
| 171 | |
| 172 | static bool __maybe_unused |
| 173 | xdrgen_encode_nfstime4(struct xdr_stream *xdr, const struct nfstime4 *value) |
| 174 | { |
| 175 | if (!xdrgen_encode_int64_t(xdr, value: value->seconds)) |
| 176 | return false; |
| 177 | if (!xdrgen_encode_uint32_t(xdr, value: value->nseconds)) |
| 178 | return false; |
| 179 | return true; |
| 180 | }; |
| 181 | |
| 182 | static bool __maybe_unused |
| 183 | xdrgen_encode_fattr4_offline(struct xdr_stream *xdr, const fattr4_offline value) |
| 184 | { |
| 185 | return xdrgen_encode_bool(xdr, val: value); |
| 186 | }; |
| 187 | |
| 188 | static bool __maybe_unused |
| 189 | xdrgen_encode_open_arguments4(struct xdr_stream *xdr, const struct open_arguments4 *value) |
| 190 | { |
| 191 | if (!xdrgen_encode_bitmap4(xdr, value: value->oa_share_access)) |
| 192 | return false; |
| 193 | if (!xdrgen_encode_bitmap4(xdr, value: value->oa_share_deny)) |
| 194 | return false; |
| 195 | if (!xdrgen_encode_bitmap4(xdr, value: value->oa_share_access_want)) |
| 196 | return false; |
| 197 | if (!xdrgen_encode_bitmap4(xdr, value: value->oa_open_claim)) |
| 198 | return false; |
| 199 | if (!xdrgen_encode_bitmap4(xdr, value: value->oa_create_mode)) |
| 200 | return false; |
| 201 | return true; |
| 202 | }; |
| 203 | |
| 204 | static bool __maybe_unused |
| 205 | xdrgen_encode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 value) |
| 206 | { |
| 207 | return xdr_stream_encode_u32(xdr, n: value) == XDR_UNIT; |
| 208 | } |
| 209 | |
| 210 | static bool __maybe_unused |
| 211 | xdrgen_encode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 value) |
| 212 | { |
| 213 | return xdr_stream_encode_u32(xdr, n: value) == XDR_UNIT; |
| 214 | } |
| 215 | |
| 216 | static bool __maybe_unused |
| 217 | xdrgen_encode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 value) |
| 218 | { |
| 219 | return xdr_stream_encode_u32(xdr, n: value) == XDR_UNIT; |
| 220 | } |
| 221 | |
| 222 | static bool __maybe_unused |
| 223 | xdrgen_encode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 value) |
| 224 | { |
| 225 | return xdr_stream_encode_u32(xdr, n: value) == XDR_UNIT; |
| 226 | } |
| 227 | |
| 228 | static bool __maybe_unused |
| 229 | xdrgen_encode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 value) |
| 230 | { |
| 231 | return xdr_stream_encode_u32(xdr, n: value) == XDR_UNIT; |
| 232 | } |
| 233 | |
| 234 | bool |
| 235 | xdrgen_encode_fattr4_open_arguments(struct xdr_stream *xdr, const fattr4_open_arguments *value) |
| 236 | { |
| 237 | return xdrgen_encode_open_arguments4(xdr, value); |
| 238 | }; |
| 239 | |
| 240 | bool |
| 241 | xdrgen_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 | |
| 246 | bool |
| 247 | xdrgen_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 | |
| 252 | static bool __maybe_unused |
| 253 | xdrgen_encode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 value) |
| 254 | { |
| 255 | return xdr_stream_encode_u32(xdr, n: value) == XDR_UNIT; |
| 256 | } |
| 257 | |