| // SPDX-License-Identifier: GPL-2.0 |
| // Generated by xdrgen. Manual edits will be lost. |
| // XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x |
| // XDR specification modification time: Tue Jun 30 11:57:21 2026 |
| |
| #include <linux/sunrpc/svc.h> |
| |
| #include "nfs4xdr_gen.h" |
| |
| static bool __maybe_unused |
| xdrgen_decode_int32_t(struct xdr_stream *xdr, int32_t *ptr) |
| { |
| return xdrgen_decode_int(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_uint32_t(struct xdr_stream *xdr, uint32_t *ptr) |
| { |
| return xdrgen_decode_unsigned_int(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_int64_t(struct xdr_stream *xdr, int64_t *ptr) |
| { |
| return xdrgen_decode_hyper(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_uint64_t(struct xdr_stream *xdr, uint64_t *ptr) |
| { |
| return xdrgen_decode_unsigned_hyper(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_nfsstat4(struct xdr_stream *xdr, nfsstat4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case NFS4_OK: |
| case NFS4ERR_PERM: |
| case NFS4ERR_NOENT: |
| case NFS4ERR_IO: |
| case NFS4ERR_NXIO: |
| case NFS4ERR_ACCESS: |
| case NFS4ERR_EXIST: |
| case NFS4ERR_XDEV: |
| case NFS4ERR_NOTDIR: |
| case NFS4ERR_ISDIR: |
| case NFS4ERR_INVAL: |
| case NFS4ERR_FBIG: |
| case NFS4ERR_NOSPC: |
| case NFS4ERR_ROFS: |
| case NFS4ERR_MLINK: |
| case NFS4ERR_NAMETOOLONG: |
| case NFS4ERR_NOTEMPTY: |
| case NFS4ERR_DQUOT: |
| case NFS4ERR_STALE: |
| case NFS4ERR_BADHANDLE: |
| case NFS4ERR_BAD_COOKIE: |
| case NFS4ERR_NOTSUPP: |
| case NFS4ERR_TOOSMALL: |
| case NFS4ERR_SERVERFAULT: |
| case NFS4ERR_BADTYPE: |
| case NFS4ERR_DELAY: |
| case NFS4ERR_SAME: |
| case NFS4ERR_DENIED: |
| case NFS4ERR_EXPIRED: |
| case NFS4ERR_LOCKED: |
| case NFS4ERR_GRACE: |
| case NFS4ERR_FHEXPIRED: |
| case NFS4ERR_SHARE_DENIED: |
| case NFS4ERR_WRONGSEC: |
| case NFS4ERR_CLID_INUSE: |
| case NFS4ERR_RESOURCE: |
| case NFS4ERR_MOVED: |
| case NFS4ERR_NOFILEHANDLE: |
| case NFS4ERR_MINOR_VERS_MISMATCH: |
| case NFS4ERR_STALE_CLIENTID: |
| case NFS4ERR_STALE_STATEID: |
| case NFS4ERR_OLD_STATEID: |
| case NFS4ERR_BAD_STATEID: |
| case NFS4ERR_BAD_SEQID: |
| case NFS4ERR_NOT_SAME: |
| case NFS4ERR_LOCK_RANGE: |
| case NFS4ERR_SYMLINK: |
| case NFS4ERR_RESTOREFH: |
| case NFS4ERR_LEASE_MOVED: |
| case NFS4ERR_ATTRNOTSUPP: |
| case NFS4ERR_NO_GRACE: |
| case NFS4ERR_RECLAIM_BAD: |
| case NFS4ERR_RECLAIM_CONFLICT: |
| case NFS4ERR_BADXDR: |
| case NFS4ERR_LOCKS_HELD: |
| case NFS4ERR_OPENMODE: |
| case NFS4ERR_BADOWNER: |
| case NFS4ERR_BADCHAR: |
| case NFS4ERR_BADNAME: |
| case NFS4ERR_BAD_RANGE: |
| case NFS4ERR_LOCK_NOTSUPP: |
| case NFS4ERR_OP_ILLEGAL: |
| case NFS4ERR_DEADLOCK: |
| case NFS4ERR_FILE_OPEN: |
| case NFS4ERR_ADMIN_REVOKED: |
| case NFS4ERR_CB_PATH_DOWN: |
| case NFS4ERR_BADIOMODE: |
| case NFS4ERR_BADLAYOUT: |
| case NFS4ERR_BAD_SESSION_DIGEST: |
| case NFS4ERR_BADSESSION: |
| case NFS4ERR_BADSLOT: |
| case NFS4ERR_COMPLETE_ALREADY: |
| case NFS4ERR_CONN_NOT_BOUND_TO_SESSION: |
| case NFS4ERR_DELEG_ALREADY_WANTED: |
| case NFS4ERR_BACK_CHAN_BUSY: |
| case NFS4ERR_LAYOUTTRYLATER: |
| case NFS4ERR_LAYOUTUNAVAILABLE: |
| case NFS4ERR_NOMATCHING_LAYOUT: |
| case NFS4ERR_RECALLCONFLICT: |
| case NFS4ERR_UNKNOWN_LAYOUTTYPE: |
| case NFS4ERR_SEQ_MISORDERED: |
| case NFS4ERR_SEQUENCE_POS: |
| case NFS4ERR_REQ_TOO_BIG: |
| case NFS4ERR_REP_TOO_BIG: |
| case NFS4ERR_REP_TOO_BIG_TO_CACHE: |
| case NFS4ERR_RETRY_UNCACHED_REP: |
| case NFS4ERR_UNSAFE_COMPOUND: |
| case NFS4ERR_TOO_MANY_OPS: |
| case NFS4ERR_OP_NOT_IN_SESSION: |
| case NFS4ERR_HASH_ALG_UNSUPP: |
| case NFS4ERR_CLIENTID_BUSY: |
| case NFS4ERR_PNFS_IO_HOLE: |
| case NFS4ERR_SEQ_FALSE_RETRY: |
| case NFS4ERR_BAD_HIGH_SLOT: |
| case NFS4ERR_DEADSESSION: |
| case NFS4ERR_ENCR_ALG_UNSUPP: |
| case NFS4ERR_PNFS_NO_LAYOUT: |
| case NFS4ERR_NOT_ONLY_OP: |
| case NFS4ERR_WRONG_CRED: |
| case NFS4ERR_WRONG_TYPE: |
| case NFS4ERR_DIRDELEG_UNAVAIL: |
| case NFS4ERR_REJECT_DELEG: |
| case NFS4ERR_RETURNCONFLICT: |
| case NFS4ERR_DELEG_REVOKED: |
| case NFS4ERR_PARTNER_NOTSUPP: |
| case NFS4ERR_PARTNER_NO_AUTH: |
| case NFS4ERR_UNION_NOTSUPP: |
| case NFS4ERR_OFFLOAD_DENIED: |
| case NFS4ERR_WRONG_LFS: |
| case NFS4ERR_BADLABEL: |
| case NFS4ERR_OFFLOAD_NO_REQS: |
| case NFS4ERR_NOXATTR: |
| case NFS4ERR_XATTR2BIG: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_attrlist4(struct xdr_stream *xdr, attrlist4 *ptr) |
| { |
| return xdrgen_decode_opaque(xdr, ptr, 0); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_bitmap4(struct xdr_stream *xdr, bitmap4 *ptr) |
| { |
| if (xdr_stream_decode_u32(xdr, &ptr->count) < 0) |
| return false; |
| for (u32 i = 0; i < ptr->count; i++) |
| if (!xdrgen_decode_uint32_t(xdr, &ptr->element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_verifier4(struct xdr_stream *xdr, verifier4 *ptr) |
| { |
| return xdr_stream_decode_opaque_fixed(xdr, ptr, NFS4_VERIFIER_SIZE) == 0; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_nfs_cookie4(struct xdr_stream *xdr, nfs_cookie4 *ptr) |
| { |
| return xdrgen_decode_uint64_t(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_nfs_fh4(struct xdr_stream *xdr, nfs_fh4 *ptr) |
| { |
| return xdrgen_decode_opaque(xdr, ptr, NFS4_FHSIZE); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_utf8string(struct xdr_stream *xdr, utf8string *ptr) |
| { |
| return xdrgen_decode_opaque(xdr, ptr, 0); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_utf8str_cis(struct xdr_stream *xdr, utf8str_cis *ptr) |
| { |
| return xdrgen_decode_utf8string(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_utf8str_cs(struct xdr_stream *xdr, utf8str_cs *ptr) |
| { |
| return xdrgen_decode_utf8string(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_utf8str_mixed(struct xdr_stream *xdr, utf8str_mixed *ptr) |
| { |
| return xdrgen_decode_utf8string(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_component4(struct xdr_stream *xdr, component4 *ptr) |
| { |
| return xdrgen_decode_utf8str_cs(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_linktext4(struct xdr_stream *xdr, linktext4 *ptr) |
| { |
| return xdrgen_decode_utf8str_cs(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_pathname4(struct xdr_stream *xdr, pathname4 *ptr) |
| { |
| if (xdr_stream_decode_u32(xdr, &ptr->count) < 0) |
| return false; |
| for (u32 i = 0; i < ptr->count; i++) |
| if (!xdrgen_decode_component4(xdr, &ptr->element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_nfstime4(struct xdr_stream *xdr, struct nfstime4 *ptr) |
| { |
| if (!xdrgen_decode_int64_t(xdr, &ptr->seconds)) |
| return false; |
| if (!xdrgen_decode_uint32_t(xdr, &ptr->nseconds)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_fattr4(struct xdr_stream *xdr, struct fattr4 *ptr) |
| { |
| if (!xdrgen_decode_bitmap4(xdr, &ptr->attrmask)) |
| return false; |
| if (!xdrgen_decode_attrlist4(xdr, &ptr->attr_vals)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_stateid4(struct xdr_stream *xdr, struct stateid4 *ptr) |
| { |
| if (!xdrgen_decode_uint32_t(xdr, &ptr->seqid)) |
| return false; |
| if (xdr_stream_decode_opaque_fixed(xdr, ptr->other, 12) < 0) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_fattr4_offline(struct xdr_stream *xdr, fattr4_offline *ptr) |
| { |
| return xdrgen_decode_bool(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_open_arguments4(struct xdr_stream *xdr, struct open_arguments4 *ptr) |
| { |
| if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access)) |
| return false; |
| if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_deny)) |
| return false; |
| if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access_want)) |
| return false; |
| if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_open_claim)) |
| return false; |
| if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_create_mode)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case OPEN_ARGS_SHARE_ACCESS_READ: |
| case OPEN_ARGS_SHARE_ACCESS_WRITE: |
| case OPEN_ARGS_SHARE_ACCESS_BOTH: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case OPEN_ARGS_SHARE_DENY_NONE: |
| case OPEN_ARGS_SHARE_DENY_READ: |
| case OPEN_ARGS_SHARE_DENY_WRITE: |
| case OPEN_ARGS_SHARE_DENY_BOTH: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case OPEN_ARGS_SHARE_ACCESS_WANT_ANY_DELEG: |
| case OPEN_ARGS_SHARE_ACCESS_WANT_NO_DELEG: |
| case OPEN_ARGS_SHARE_ACCESS_WANT_CANCEL: |
| case OPEN_ARGS_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL: |
| case OPEN_ARGS_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED: |
| case OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS: |
| case OPEN_ARGS_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case OPEN_ARGS_OPEN_CLAIM_NULL: |
| case OPEN_ARGS_OPEN_CLAIM_PREVIOUS: |
| case OPEN_ARGS_OPEN_CLAIM_DELEGATE_CUR: |
| case OPEN_ARGS_OPEN_CLAIM_DELEGATE_PREV: |
| case OPEN_ARGS_OPEN_CLAIM_FH: |
| case OPEN_ARGS_OPEN_CLAIM_DELEG_CUR_FH: |
| case OPEN_ARGS_OPEN_CLAIM_DELEG_PREV_FH: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case OPEN_ARGS_CREATEMODE_UNCHECKED4: |
| case OPEN_ARGS_CREATE_MODE_GUARDED: |
| case OPEN_ARGS_CREATEMODE_EXCLUSIVE4: |
| case OPEN_ARGS_CREATE_MODE_EXCLUSIVE4_1: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_fattr4_open_arguments(struct xdr_stream *xdr, fattr4_open_arguments *ptr) |
| { |
| return xdrgen_decode_open_arguments4(xdr, ptr); |
| } |
| |
| /* |
| * Determine what OPEN supports. |
| */ |
| |
| bool |
| xdrgen_decode_fattr4_time_deleg_access(struct xdr_stream *xdr, fattr4_time_deleg_access *ptr) |
| { |
| return xdrgen_decode_nfstime4(xdr, ptr); |
| } |
| |
| bool |
| xdrgen_decode_fattr4_time_deleg_modify(struct xdr_stream *xdr, fattr4_time_deleg_modify *ptr) |
| { |
| return xdrgen_decode_nfstime4(xdr, ptr); |
| } |
| |
| /* |
| * New RECOMMENDED Attribute for |
| * delegation caching of times |
| */ |
| |
| static bool __maybe_unused |
| xdrgen_decode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case OPEN_DELEGATE_NONE: |
| case OPEN_DELEGATE_READ: |
| case OPEN_DELEGATE_WRITE: |
| case OPEN_DELEGATE_NONE_EXT: |
| case OPEN_DELEGATE_READ_ATTRS_DELEG: |
| case OPEN_DELEGATE_WRITE_ATTRS_DELEG: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_aclmodel4(struct xdr_stream *xdr, aclmodel4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case ACL_MODEL_NFS4: |
| case ACL_MODEL_POSIX_DRAFT: |
| case ACL_MODEL_NONE: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_aclscope4(struct xdr_stream *xdr, aclscope4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case ACL_SCOPE_FILE_OBJECT: |
| case ACL_SCOPE_FILE_SYSTEM: |
| case ACL_SCOPE_SERVER: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_posixacetag4(struct xdr_stream *xdr, posixacetag4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case POSIXACE4_TAG_USER_OBJ: |
| case POSIXACE4_TAG_USER: |
| case POSIXACE4_TAG_GROUP_OBJ: |
| case POSIXACE4_TAG_GROUP: |
| case POSIXACE4_TAG_MASK: |
| case POSIXACE4_TAG_OTHER: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_posixaceperm4(struct xdr_stream *xdr, posixaceperm4 *ptr) |
| { |
| return xdrgen_decode_uint32_t(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_posixace4(struct xdr_stream *xdr, struct posixace4 *ptr) |
| { |
| if (!xdrgen_decode_posixacetag4(xdr, &ptr->tag)) |
| return false; |
| if (!xdrgen_decode_posixaceperm4(xdr, &ptr->perm)) |
| return false; |
| if (!xdrgen_decode_utf8str_mixed(xdr, &ptr->who)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_fattr4_acl_trueform(struct xdr_stream *xdr, fattr4_acl_trueform *ptr) |
| { |
| return xdrgen_decode_aclmodel4(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_fattr4_acl_trueform_scope(struct xdr_stream *xdr, fattr4_acl_trueform_scope *ptr) |
| { |
| return xdrgen_decode_aclscope4(xdr, ptr); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_fattr4_posix_default_acl(struct xdr_stream *xdr, fattr4_posix_default_acl *ptr) |
| { |
| if (xdr_stream_decode_u32(xdr, &ptr->count) < 0) |
| return false; |
| for (u32 i = 0; i < ptr->count; i++) |
| if (!xdrgen_decode_posixace4(xdr, &ptr->element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_fattr4_posix_access_acl(struct xdr_stream *xdr, fattr4_posix_access_acl *ptr) |
| { |
| if (xdr_stream_decode_u32(xdr, &ptr->count) < 0) |
| return false; |
| for (u32 i = 0; i < ptr->count; i++) |
| if (!xdrgen_decode_posixace4(xdr, &ptr->element[i])) |
| return false; |
| return true; |
| } |
| |
| /* |
| * New for POSIX ACL extension |
| */ |
| |
| static bool __maybe_unused |
| xdrgen_decode_notify_type4(struct xdr_stream *xdr, notify_type4 *ptr) |
| { |
| u32 val; |
| |
| if (xdr_stream_decode_u32(xdr, &val) < 0) |
| return false; |
| /* Compiler may optimize to a range check for dense enums */ |
| switch (val) { |
| case NOTIFY4_CHANGE_CHILD_ATTRS: |
| case NOTIFY4_CHANGE_DIR_ATTRS: |
| case NOTIFY4_REMOVE_ENTRY: |
| case NOTIFY4_ADD_ENTRY: |
| case NOTIFY4_RENAME_ENTRY: |
| case NOTIFY4_CHANGE_COOKIE_VERIFIER: |
| case NOTIFY4_GFLAG_EXTEND: |
| case NOTIFY4_AUFLAG_VALID: |
| case NOTIFY4_AUFLAG_USER: |
| case NOTIFY4_AUFLAG_GROUP: |
| case NOTIFY4_AUFLAG_OTHER: |
| case NOTIFY4_CHANGE_AUTH: |
| case NOTIFY4_CFLAG_ORDER: |
| case NOTIFY4_AUFLAG_GANOW: |
| case NOTIFY4_AUFLAG_GALATER: |
| case NOTIFY4_CHANGE_GA: |
| case NOTIFY4_CHANGE_AMASK: |
| break; |
| default: |
| return false; |
| } |
| *ptr = val; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_notify_entry4(struct xdr_stream *xdr, struct notify_entry4 *ptr) |
| { |
| if (!xdrgen_decode_component4(xdr, &ptr->ne_file)) |
| return false; |
| if (!xdrgen_decode_fattr4(xdr, &ptr->ne_attrs)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_prev_entry4(struct xdr_stream *xdr, struct prev_entry4 *ptr) |
| { |
| if (!xdrgen_decode_notify_entry4(xdr, &ptr->pe_prev_entry)) |
| return false; |
| if (!xdrgen_decode_nfs_cookie4(xdr, &ptr->pe_prev_entry_cookie)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_notify_remove4(struct xdr_stream *xdr, struct notify_remove4 *ptr) |
| { |
| if (!xdrgen_decode_notify_entry4(xdr, &ptr->nrm_old_entry)) |
| return false; |
| if (!xdrgen_decode_nfs_cookie4(xdr, &ptr->nrm_old_entry_cookie)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_notify_add4(struct xdr_stream *xdr, struct notify_add4 *ptr) |
| { |
| if (xdr_stream_decode_u32(xdr, &ptr->nad_old_entry.count) < 0) |
| return false; |
| if (ptr->nad_old_entry.count > 1) |
| return false; |
| for (u32 i = 0; i < ptr->nad_old_entry.count; i++) |
| if (!xdrgen_decode_notify_remove4(xdr, &ptr->nad_old_entry.element[i])) |
| return false; |
| if (!xdrgen_decode_notify_entry4(xdr, &ptr->nad_new_entry)) |
| return false; |
| if (xdr_stream_decode_u32(xdr, &ptr->nad_new_entry_cookie.count) < 0) |
| return false; |
| if (ptr->nad_new_entry_cookie.count > 1) |
| return false; |
| for (u32 i = 0; i < ptr->nad_new_entry_cookie.count; i++) |
| if (!xdrgen_decode_nfs_cookie4(xdr, &ptr->nad_new_entry_cookie.element[i])) |
| return false; |
| if (xdr_stream_decode_u32(xdr, &ptr->nad_prev_entry.count) < 0) |
| return false; |
| if (ptr->nad_prev_entry.count > 1) |
| return false; |
| for (u32 i = 0; i < ptr->nad_prev_entry.count; i++) |
| if (!xdrgen_decode_prev_entry4(xdr, &ptr->nad_prev_entry.element[i])) |
| return false; |
| if (!xdrgen_decode_bool(xdr, &ptr->nad_last_entry)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_notify_attr4(struct xdr_stream *xdr, struct notify_attr4 *ptr) |
| { |
| if (!xdrgen_decode_notify_entry4(xdr, &ptr->na_changed_entry)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_notify_rename4(struct xdr_stream *xdr, struct notify_rename4 *ptr) |
| { |
| if (!xdrgen_decode_notify_remove4(xdr, &ptr->nrn_old_entry)) |
| return false; |
| if (!xdrgen_decode_notify_add4(xdr, &ptr->nrn_new_entry)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_notify_verifier4(struct xdr_stream *xdr, struct notify_verifier4 *ptr) |
| { |
| if (!xdrgen_decode_verifier4(xdr, &ptr->nv_old_cookieverf)) |
| return false; |
| if (!xdrgen_decode_verifier4(xdr, &ptr->nv_new_cookieverf)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_notifylist4(struct xdr_stream *xdr, notifylist4 *ptr) |
| { |
| return xdrgen_decode_opaque(xdr, ptr, 0); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_notify4(struct xdr_stream *xdr, struct notify4 *ptr) |
| { |
| if (!xdrgen_decode_bitmap4(xdr, &ptr->notify_mask)) |
| return false; |
| if (!xdrgen_decode_notifylist4(xdr, &ptr->notify_vals)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_decode_CB_NOTIFY4args(struct xdr_stream *xdr, struct CB_NOTIFY4args *ptr) |
| { |
| if (!xdrgen_decode_stateid4(xdr, &ptr->cna_stateid)) |
| return false; |
| if (!xdrgen_decode_nfs_fh4(xdr, &ptr->cna_fh)) |
| return false; |
| if (xdr_stream_decode_u32(xdr, &ptr->cna_changes.count) < 0) |
| return false; |
| for (u32 i = 0; i < ptr->cna_changes.count; i++) |
| if (!xdrgen_decode_notify4(xdr, &ptr->cna_changes.element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_decode_CB_NOTIFY4res(struct xdr_stream *xdr, struct CB_NOTIFY4res *ptr) |
| { |
| if (!xdrgen_decode_nfsstat4(xdr, &ptr->cnr_status)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_int32_t(struct xdr_stream *xdr, const int32_t value) |
| { |
| return xdrgen_encode_int(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_uint32_t(struct xdr_stream *xdr, const uint32_t value) |
| { |
| return xdrgen_encode_unsigned_int(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_int64_t(struct xdr_stream *xdr, const int64_t value) |
| { |
| return xdrgen_encode_hyper(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_uint64_t(struct xdr_stream *xdr, const uint64_t value) |
| { |
| return xdrgen_encode_unsigned_hyper(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_nfsstat4(struct xdr_stream *xdr, nfsstat4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_attrlist4(struct xdr_stream *xdr, const attrlist4 value) |
| { |
| return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_bitmap4(struct xdr_stream *xdr, const bitmap4 value) |
| { |
| if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value.count; i++) |
| if (!xdrgen_encode_uint32_t(xdr, value.element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_verifier4(struct xdr_stream *xdr, const verifier4 value) |
| { |
| return xdr_stream_encode_opaque_fixed(xdr, value, NFS4_VERIFIER_SIZE) >= 0; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_nfs_cookie4(struct xdr_stream *xdr, const nfs_cookie4 value) |
| { |
| return xdrgen_encode_uint64_t(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_nfs_fh4(struct xdr_stream *xdr, const nfs_fh4 value) |
| { |
| return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_utf8string(struct xdr_stream *xdr, const utf8string value) |
| { |
| return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_utf8str_cis(struct xdr_stream *xdr, const utf8str_cis value) |
| { |
| return xdrgen_encode_utf8string(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_utf8str_cs(struct xdr_stream *xdr, const utf8str_cs value) |
| { |
| return xdrgen_encode_utf8string(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_utf8str_mixed(struct xdr_stream *xdr, const utf8str_mixed value) |
| { |
| return xdrgen_encode_utf8string(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_component4(struct xdr_stream *xdr, const component4 value) |
| { |
| return xdrgen_encode_utf8str_cs(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_linktext4(struct xdr_stream *xdr, const linktext4 value) |
| { |
| return xdrgen_encode_utf8str_cs(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_pathname4(struct xdr_stream *xdr, const pathname4 value) |
| { |
| if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value.count; i++) |
| if (!xdrgen_encode_component4(xdr, value.element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_nfstime4(struct xdr_stream *xdr, const struct nfstime4 *value) |
| { |
| if (!xdrgen_encode_int64_t(xdr, value->seconds)) |
| return false; |
| if (!xdrgen_encode_uint32_t(xdr, value->nseconds)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_fattr4(struct xdr_stream *xdr, const struct fattr4 *value) |
| { |
| if (!xdrgen_encode_bitmap4(xdr, value->attrmask)) |
| return false; |
| if (!xdrgen_encode_attrlist4(xdr, value->attr_vals)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_stateid4(struct xdr_stream *xdr, const struct stateid4 *value) |
| { |
| if (!xdrgen_encode_uint32_t(xdr, value->seqid)) |
| return false; |
| if (xdr_stream_encode_opaque_fixed(xdr, value->other, 12) < 0) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_fattr4_offline(struct xdr_stream *xdr, const fattr4_offline value) |
| { |
| return xdrgen_encode_bool(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_open_arguments4(struct xdr_stream *xdr, const struct open_arguments4 *value) |
| { |
| if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access)) |
| return false; |
| if (!xdrgen_encode_bitmap4(xdr, value->oa_share_deny)) |
| return false; |
| if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access_want)) |
| return false; |
| if (!xdrgen_encode_bitmap4(xdr, value->oa_open_claim)) |
| return false; |
| if (!xdrgen_encode_bitmap4(xdr, value->oa_create_mode)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| bool |
| xdrgen_encode_fattr4_open_arguments(struct xdr_stream *xdr, const fattr4_open_arguments *value) |
| { |
| return xdrgen_encode_open_arguments4(xdr, value); |
| } |
| |
| bool |
| xdrgen_encode_fattr4_time_deleg_access(struct xdr_stream *xdr, const fattr4_time_deleg_access *value) |
| { |
| return xdrgen_encode_nfstime4(xdr, value); |
| } |
| |
| bool |
| xdrgen_encode_fattr4_time_deleg_modify(struct xdr_stream *xdr, const fattr4_time_deleg_modify *value) |
| { |
| return xdrgen_encode_nfstime4(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| bool |
| xdrgen_encode_aclmodel4(struct xdr_stream *xdr, aclmodel4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| bool |
| xdrgen_encode_aclscope4(struct xdr_stream *xdr, aclscope4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| bool |
| xdrgen_encode_posixacetag4(struct xdr_stream *xdr, posixacetag4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| bool |
| xdrgen_encode_posixaceperm4(struct xdr_stream *xdr, const posixaceperm4 value) |
| { |
| return xdrgen_encode_uint32_t(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_posixace4(struct xdr_stream *xdr, const struct posixace4 *value) |
| { |
| if (!xdrgen_encode_posixacetag4(xdr, value->tag)) |
| return false; |
| if (!xdrgen_encode_posixaceperm4(xdr, value->perm)) |
| return false; |
| if (!xdrgen_encode_utf8str_mixed(xdr, value->who)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_fattr4_acl_trueform(struct xdr_stream *xdr, const fattr4_acl_trueform value) |
| { |
| return xdrgen_encode_aclmodel4(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_fattr4_acl_trueform_scope(struct xdr_stream *xdr, const fattr4_acl_trueform_scope value) |
| { |
| return xdrgen_encode_aclscope4(xdr, value); |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_fattr4_posix_default_acl(struct xdr_stream *xdr, const fattr4_posix_default_acl value) |
| { |
| if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value.count; i++) |
| if (!xdrgen_encode_posixace4(xdr, &value.element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_fattr4_posix_access_acl(struct xdr_stream *xdr, const fattr4_posix_access_acl value) |
| { |
| if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value.count; i++) |
| if (!xdrgen_encode_posixace4(xdr, &value.element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_notify_type4(struct xdr_stream *xdr, notify_type4 value) |
| { |
| return xdr_stream_encode_u32(xdr, value) == XDR_UNIT; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_notify_entry4(struct xdr_stream *xdr, const struct notify_entry4 *value) |
| { |
| if (!xdrgen_encode_component4(xdr, value->ne_file)) |
| return false; |
| if (!xdrgen_encode_fattr4(xdr, &value->ne_attrs)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_prev_entry4(struct xdr_stream *xdr, const struct prev_entry4 *value) |
| { |
| if (!xdrgen_encode_notify_entry4(xdr, &value->pe_prev_entry)) |
| return false; |
| if (!xdrgen_encode_nfs_cookie4(xdr, value->pe_prev_entry_cookie)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_encode_notify_remove4(struct xdr_stream *xdr, const struct notify_remove4 *value) |
| { |
| if (!xdrgen_encode_notify_entry4(xdr, &value->nrm_old_entry)) |
| return false; |
| if (!xdrgen_encode_nfs_cookie4(xdr, value->nrm_old_entry_cookie)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_encode_notify_add4(struct xdr_stream *xdr, const struct notify_add4 *value) |
| { |
| if (value->nad_old_entry.count > 1) |
| return false; |
| if (xdr_stream_encode_u32(xdr, value->nad_old_entry.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value->nad_old_entry.count; i++) |
| if (!xdrgen_encode_notify_remove4(xdr, &value->nad_old_entry.element[i])) |
| return false; |
| if (!xdrgen_encode_notify_entry4(xdr, &value->nad_new_entry)) |
| return false; |
| if (value->nad_new_entry_cookie.count > 1) |
| return false; |
| if (xdr_stream_encode_u32(xdr, value->nad_new_entry_cookie.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value->nad_new_entry_cookie.count; i++) |
| if (!xdrgen_encode_nfs_cookie4(xdr, value->nad_new_entry_cookie.element[i])) |
| return false; |
| if (value->nad_prev_entry.count > 1) |
| return false; |
| if (xdr_stream_encode_u32(xdr, value->nad_prev_entry.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value->nad_prev_entry.count; i++) |
| if (!xdrgen_encode_prev_entry4(xdr, &value->nad_prev_entry.element[i])) |
| return false; |
| if (!xdrgen_encode_bool(xdr, value->nad_last_entry)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_encode_notify_attr4(struct xdr_stream *xdr, const struct notify_attr4 *value) |
| { |
| if (!xdrgen_encode_notify_entry4(xdr, &value->na_changed_entry)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_encode_notify_rename4(struct xdr_stream *xdr, const struct notify_rename4 *value) |
| { |
| if (!xdrgen_encode_notify_remove4(xdr, &value->nrn_old_entry)) |
| return false; |
| if (!xdrgen_encode_notify_add4(xdr, &value->nrn_new_entry)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_notify_verifier4(struct xdr_stream *xdr, const struct notify_verifier4 *value) |
| { |
| if (!xdrgen_encode_verifier4(xdr, value->nv_old_cookieverf)) |
| return false; |
| if (!xdrgen_encode_verifier4(xdr, value->nv_new_cookieverf)) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_notifylist4(struct xdr_stream *xdr, const notifylist4 value) |
| { |
| return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_notify4(struct xdr_stream *xdr, const struct notify4 *value) |
| { |
| if (!xdrgen_encode_bitmap4(xdr, value->notify_mask)) |
| return false; |
| if (!xdrgen_encode_notifylist4(xdr, value->notify_vals)) |
| return false; |
| return true; |
| } |
| |
| bool |
| xdrgen_encode_CB_NOTIFY4args(struct xdr_stream *xdr, const struct CB_NOTIFY4args *value) |
| { |
| if (!xdrgen_encode_stateid4(xdr, &value->cna_stateid)) |
| return false; |
| if (!xdrgen_encode_nfs_fh4(xdr, value->cna_fh)) |
| return false; |
| if (xdr_stream_encode_u32(xdr, value->cna_changes.count) != XDR_UNIT) |
| return false; |
| for (u32 i = 0; i < value->cna_changes.count; i++) |
| if (!xdrgen_encode_notify4(xdr, &value->cna_changes.element[i])) |
| return false; |
| return true; |
| } |
| |
| static bool __maybe_unused |
| xdrgen_encode_CB_NOTIFY4res(struct xdr_stream *xdr, const struct CB_NOTIFY4res *value) |
| { |
| if (!xdrgen_encode_nfsstat4(xdr, value->cnr_status)) |
| return false; |
| return true; |
| } |