/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
/*
* A handcoded version based on the original rpcgen code.
*
* Note: All future NFS4 protocol changes should be added by hand
* to this file.
*
* CAUTION: All protocol changes must also be propagated to:
*/
#include <nfs/nfs4_kprot.h>
#include <nfs/nfs4_clnt.h>
#include <rpc/rpc_rdma.h>
const xdrproc_t);
{
return (TRUE);
/*
* Simplified bitmap4 processing, always encode from uint64_t
* to 2 uint32_t's, always decode first 2 uint32_t's into a
* uint64_t and ignore all of the rest.
*/
len = 2;
return (FALSE);
#if defined(_LITTLE_ENDIAN)
BYTES_PER_XDR_UNIT)) == TRUE) {
}
#elif defined(_BIG_ENDIAN)
}
#endif
return (FALSE);
}
return (FALSE);
/*
* Common fast DECODE cases
*/
if (len == 2) {
#if defined(_LITTLE_ENDIAN)
BYTES_PER_XDR_UNIT)) == TRUE) {
}
#elif defined(_BIG_ENDIAN)
}
#endif
return (FALSE);
}
*objp = 0;
if (len == 0)
return (TRUE);
/*
* The not so common DECODE cases, len == 1 || len > 2
*/
#if defined(_LITTLE_ENDIAN)
return (FALSE);
if (--len == 0)
return (TRUE);
return (FALSE);
#elif defined(_BIG_ENDIAN)
return (FALSE);
if (--len == 0)
return (TRUE);
return (FALSE);
#else
return (FALSE);
#endif
if (--len == 0)
return (TRUE);
}
/* Called by xdr_array, nfsid_map_xdr */
{
}
return (TRUE);
}
/*
* used by NFSv4 referrals to get info needed for NFSv4 referral mount.
*/
{
return (FALSE);
return (FALSE);
return (FALSE);
#if defined(_LP64)
/*
* The object can come from a 32-bit binary; nfsmapid.
* To be safe we double the size of the knetconfig to
* allow some buffering for decoding.
*/
#endif
return (FALSE);
return (FALSE);
return (FALSE);
return (TRUE);
}
{
#if !defined(_LP64)
#endif
int i;
return (FALSE);
sizeof (struct knetconfig));
}
return (FALSE);
return (FALSE);
/*
* For interoperability between 32-bit daemon and 64-bit kernel,
* we always treat dev_t as 64-bit number and do the expanding
* or compression of dev_t as needed.
* We have to hand craft the conversion since there is no available
* and we want to keep both user and kernel of xdr_knetconfig() the
* same for consistency.
*/
#if defined(_LP64)
#else
#endif
return (FALSE);
}
#if defined(_LP64)
return (FALSE);
#else
return (FALSE);
#endif
}
return (FALSE);
} else {
i < 8; i++) {
#else
#endif
}
}
return (TRUE);
return (FALSE);
} else {
i < 8; i++) {
#else
#endif
}
}
return (TRUE);
}
return (FALSE);
return (TRUE);
}
/*
* XDR_INLINE decode a filehandle.
*/
{
/*
* Check to see if what the client sent us is bigger or smaller
* than what we can ever possibly send out. NFS_FHMAXDATA is
* unfortunately badly named as it is no longer the max and is
* really the min of what is sent over the wire.
*/
sizeof (ushort_t) + NFS_FHMAXDATA +
sizeof (ushort_t) + NFS_FHMAXDATA)) {
return (FALSE);
}
/*
* All internal parts of a filehandle are in native byte order.
*
* Decode what should be fh4_fsid, it is aligned.
*/
bp += BYTES_PER_XDR_UNIT;
bp += BYTES_PER_XDR_UNIT;
/*
* Decode what should be fh4_len. fh4_len is two bytes, so we're
* unaligned now.
*/
/*
* For backwards compatibility, the fid length may be less than
* NFS_FHMAXDATA, but it was always encoded as NFS_FHMAXDATA bytes.
*/
/*
* Make sure the client isn't sending us a bogus length for fh4_data.
*/
return (FALSE);
return (FALSE);
/*
* Make sure the client isn't sending us a bogus length for fh4_xdata.
*/
return (FALSE);
/*
* We realign things on purpose, so skip any padding
*/
if (resid != 0) {
return (FALSE);
}
if (fhsize < BYTES_PER_XDR_UNIT)
return (FALSE);
bp += BYTES_PER_XDR_UNIT;
#ifdef VOLATILE_FH_TEST
if (fhsize < BYTES_PER_XDR_UNIT)
return (FALSE);
bp += BYTES_PER_XDR_UNIT;
#endif
/*
* Make sure client didn't send extra bytes
*/
if (fhsize != 0)
return (FALSE);
return (TRUE);
}
static bool_t
{
/*
* Retrieve the filehandle length.
*/
return (FALSE);
objp->nfs_fh4_len = 0;
/*
* Check to see if what the client sent us is bigger or smaller
* than what we can ever possibly send out. NFS_FHMAXDATA is
* unfortunately badly named as it is no longer the max and is
* really the min of what is sent over the wire.
*/
sizeof (ushort_t) + NFS_FHMAXDATA +
sizeof (ushort_t) + NFS_FHMAXDATA)) {
return (FALSE);
return (TRUE);
}
/*
* bring in fhsize plus any padding
*/
return (FALSE);
}
}
/*
* If in the process of decoding we find the file handle
* is not correctly formed, we need to continue decoding
* and trigger an NFS layer error. Set the nfs_fh4_len to
* zero so it gets caught as a bad length.
*/
objp->nfs_fh4_len = 0;
}
return (TRUE);
}
/*
* XDR_INLINE encode a filehandle.
*/
{
/*
* First get the initial and variable sized part of the filehandle.
*/
/*
* Round out to a full word.
*/
/*
* Add in the fixed sized pieces.
*/
#ifdef VOLATILE_FH_TEST
#endif
/*
* Make sure we don't exceed our buffer.
*/
return (FALSE);
/*
* Zero out the padding.
*/
/*
* The rest of the filehandle is in native byteorder
*/
/* fh4_fsid */
/*
* Since the next pieces are unaligned, we need to
* do bytewise copies.
*/
/* fh4_len + fh4_data */
/* fh4_xlen + fh4_xdata */
/*
* With the above padding, we're word aligned again.
*/
/* fh4_flag */
#ifdef VOLATILE_FH_TEST
/* fh4_volatile_id */
#endif
return (TRUE);
}
static bool_t
{
/*
* First get the over the wire size, it is the 4 bytes
* for the length, plus the combined size of the
* file handle components.
*/
#ifdef VOLATILE_FH_TEST
#endif
/*
* Round out to a full word.
*/
/*
* Next try to inline the XDR stream, if that fails (rare)
* allocate a buffer to encode the file handle and then
* copy it using xdr_opaque and free the buffer.
*/
}
return (ret);
}
/*
* XDR a NFSv4 filehandle.
* Encoding interprets the contents (server).
* Decoding the contents are opaque (client).
*/
{
case XDR_ENCODE:
case XDR_DECODE:
case XDR_FREE:
}
return (TRUE);
}
return (FALSE);
}
/* Called by xdr_array */
static bool_t
{
}
return (FALSE);
}
/* Called by xdr_array */
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
}
}
/*
* Optimized free case
*/
}
return (TRUE);
}
/*
* These functions are called out of nfs4_attr.c
*/
{
return (TRUE);
return (FALSE);
}
{
}
{
}
return (FALSE);
}
{
return (TRUE);
return (FALSE);
}
{
return (TRUE);
return (FALSE);
}
/*
* structured used for calls into xdr_ga_fattr_res() as a means
* to do an immediate/short-term cache of owner/group strings
* for callers like the readdir processing. In the case of readdir,
* it is likely that the directory objects will be owned by the same
* having one here will reduct pathlength further.
*/
typedef struct ug_cache
{
} ug_cache_t;
} else { \
}
} else { \
}
static ug_cache_t *
{
return (pug);
}
static void
{
AT_ALL, /* va_mask */
VNON, /* va_type */
0777, /* va_mode */
UID_NOBODY, /* va_uid */
GID_NOBODY, /* va_gid */
0, /* va_fsid */
0, /* va_nodeid */
1, /* va_nlink */
0, /* va_size */
{0, 0}, /* va_atime */
{0, 0}, /* va_mtime */
{0, 0}, /* va_ctime */
0, /* va_rdev */
MAXBSIZE, /* va_blksize */
0, /* va_nblocks */
0 /* va_seq */
};
}
static void
{
MAXBSIZE, /* f_bsize */
DEV_BSIZE, /* f_frsize */
0, /* f_fsid */
"\0", /* f_basetype */
0, /* f_flag */
MAXNAMELEN, /* f_namemax */
"\0", /* f_fstr */
};
}
static bool_t
{
int truefalse;
if (garp->n4g_ext_res)
else
/* Check to see if the vattr should be pre-filled */
if (argbmap & NFS4_VATTR_MASK)
if (argbmap & NFS4_STATFS_ATTR_MASK)
if (resbmap &
if (resbmap & FATTR4_SUPPORTED_ATTRS_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_TYPE_MASK) {
return (FALSE);
else
}
if (resbmap & FATTR4_FH_EXPIRE_TYPE_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_CHANGE_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_SIZE_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
} else {
}
}
if (resbmap & FATTR4_LINK_SUPPORT_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_SYMLINK_SUPPORT_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_NAMED_ATTR_MASK) {
return (FALSE);
}
}
if (resbmap &
if (resbmap & FATTR4_FSID_MASK) {
if ((!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_UNIQUE_HANDLES_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_LEASE_TIME_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_RDATTR_ERROR_MASK) {
if (!XDR_GETINT32(xdrs,
(int *)&gesp->n4g_rdattr_error))
return (FALSE);
}
}
if (resbmap &
if (resbmap & FATTR4_ACL_MASK) {
acl.fattr4_acl_len = 0;
return (FALSE);
}
if (resbmap & FATTR4_ACLSUPPORT_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_ARCHIVE_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_CANSETTIME_MASK) {
return (FALSE);
}
}
if (resbmap &
if (resbmap & FATTR4_CASE_INSENSITIVE_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_CASE_PRESERVING_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_CHOWN_RESTRICTED_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_FILEHANDLE_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_FILEID_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_FILES_AVAIL_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_FILES_FREE_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_FILES_TOTAL_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
}
if (resbmap &
if (resbmap & FATTR4_FS_LOCATIONS_MASK) {
if (!xdr_fattr4_fs_locations(xdrs,
&gesp->n4g_fslocations))
return (FALSE);
}
if (resbmap & FATTR4_HIDDEN_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_HOMOGENEOUS_MASK) {
return (FALSE);
}
}
if (resbmap &
if (resbmap & FATTR4_MAXFILESIZE_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_MAXLINK_MASK) {
if (!XDR_GETINT32(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_MAXNAME_MASK) {
if (!XDR_GETINT32(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_MAXREAD_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_MAXWRITE_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
}
if (resbmap &
if (resbmap & FATTR4_MIMETYPE_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_MODE_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_NO_TRUNC_MASK) {
return (FALSE);
}
if (resbmap & FATTR4_NUMLINKS_MASK) {
return (FALSE);
}
}
if (resbmap &
if (resbmap & FATTR4_OWNER_MASK) {
int error;
/* get the OWNER_LENGTH */
return (FALSE);
/* Manage the owner length location */
*owner_length = ol;
} else {
owner_length = &ol;
}
/* find memory to store the decode */
owner_val = owner_alloc =
else
/* get the OWNER string */
if (owner_alloc)
return (FALSE);
}
/* Optimize for matching if called for */
if (pug &&
*owner_length) == 0) {
} else {
/*
* String was mapped, but to nobody because
* we are nfsmapid, indicate it should not
* be cached.
*/
error = 0;
garp->n4g_attrwhy =
}
if (error) {
garp->n4g_attrwhy =
} else {
}
}
if (owner_alloc)
}
}
if (resbmap & FATTR4_OWNER_GROUP_MASK) {
int error;
/* get the OWNER_GROUP_LENGTH */
return (FALSE);
/* Manage the group length location */
*group_length = gl;
} else {
group_length = ≷
}
/* find memory to store the decode */
group_val = group_alloc =
else
/* get the OWNER_GROUP string */
if (group_alloc)
return (FALSE);
}
/* Optimize for matching if called for */
if (pug &&
*group_length) == 0) {
} else {
/*
* String was mapped, but to nobody because
* we are nfsmapid, indicate it should not
* be cached.
*/
error = 0;
garp->n4g_attrwhy =
}
if (error) {
garp->n4g_attrwhy =
} else {
}
}
if (group_alloc) {
}
}
}
if (resbmap & FATTR4_QUOTA_AVAIL_HARD_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_QUOTA_AVAIL_SOFT_MASK) {
ASSERT(0);
}
}
if (resbmap &
if (resbmap & FATTR4_QUOTA_USED_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_RAWDEV_MASK) {
return (FALSE);
} else {
}
}
if (resbmap & FATTR4_SPACE_AVAIL_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_SPACE_FREE_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_SPACE_TOTAL_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_SPACE_USED_MASK) {
if (!xdr_u_longlong_t(xdrs,
(u_longlong_t *)&space_used))
return (FALSE);
/* Compute space depending on device type */
} else {
vap->va_nblocks = 0;
}
}
if (resbmap & FATTR4_SYSTEM_MASK) {
ASSERT(0);
}
}
if (resbmap &
if (resbmap & FATTR4_TIME_ACCESS_MASK) {
int error;
if (!xdr_longlong_t(xdrs,
return (FALSE);
return (FALSE);
if (error) {
}
}
if (resbmap & FATTR4_TIME_ACCESS_SET_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_TIME_BACKUP_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_TIME_CREATE_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_TIME_DELTA_MASK) {
if ((!xdr_u_longlong_t(xdrs,
return (FALSE);
}
if (resbmap & FATTR4_TIME_METADATA_MASK) {
int error;
return (FALSE);
return (FALSE);
if (error) {
}
}
if (resbmap & FATTR4_TIME_MODIFY_MASK) {
int error;
if (!xdr_longlong_t(xdrs,
return (FALSE);
return (FALSE);
if (error) {
}
}
if (resbmap & FATTR4_TIME_MODIFY_SET_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_MOUNTED_ON_FILEID_MASK) {
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
}
/* copy only if not provided */
}
}
return (TRUE);
}
/*
* Inlined version of get_bitmap4 processing
*/
{
/* bitmap LENGTH */
/* Inline the bitmap and attrlen for common case of two word map */
if (resbmaplen == 2) {
return (bm);
}
#if defined(_LITTLE_ENDIAN)
if (--resbmaplen == 0) {
return (bm);
}
if (--resbmaplen == 0) {
return (bm);
}
ptr += resbmaplen;
return (bm);
#elif defined(_BIG_ENDIAN)
if (--resbmaplen == 0) {
return (bm);
}
if (--resbmaplen == 0) {
return (bm);
}
ptr += resbmaplen;
return (bm);
#else
ASSERT(0);
ptr += resbmaplen;
return (0);
#endif
}
static bool_t
{
int truefalse;
if (garp->n4g_ext_res)
else
/* Check to see if the vattr should be pre-filled */
if (argbmap & NFS4_VATTR_MASK)
if (argbmap & NFS4_STATFS_ATTR_MASK)
if (resbmap &
if (resbmap & FATTR4_SUPPORTED_ATTRS_MASK) {
}
if (resbmap & FATTR4_TYPE_MASK) {
else
}
if (resbmap & FATTR4_FH_EXPIRE_TYPE_MASK) {
}
if (resbmap & FATTR4_CHANGE_MASK) {
}
if (resbmap & FATTR4_SIZE_MASK) {
} else {
}
}
if (resbmap & FATTR4_LINK_SUPPORT_MASK) {
}
if (resbmap & FATTR4_SYMLINK_SUPPORT_MASK) {
}
if (resbmap & FATTR4_NAMED_ATTR_MASK) {
}
}
if (resbmap &
if (resbmap & FATTR4_FSID_MASK) {
}
if (resbmap & FATTR4_UNIQUE_HANDLES_MASK) {
}
if (resbmap & FATTR4_LEASE_TIME_MASK) {
}
if (resbmap & FATTR4_RDATTR_ERROR_MASK) {
}
}
if (resbmap &
if (resbmap & FATTR4_ACL_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_ACLSUPPORT_MASK) {
}
if (resbmap & FATTR4_ARCHIVE_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_CANSETTIME_MASK) {
}
}
if (resbmap &
if (resbmap & FATTR4_CASE_INSENSITIVE_MASK) {
}
if (resbmap & FATTR4_CASE_PRESERVING_MASK) {
}
if (resbmap & FATTR4_CHOWN_RESTRICTED_MASK) {
}
if (resbmap & FATTR4_FILEHANDLE_MASK) {
}
if (resbmap & FATTR4_FILEID_MASK) {
}
if (resbmap & FATTR4_FILES_AVAIL_MASK) {
}
if (resbmap & FATTR4_FILES_FREE_MASK) {
}
if (resbmap & FATTR4_FILES_TOTAL_MASK) {
}
}
if (resbmap &
if (resbmap & FATTR4_FS_LOCATIONS_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_HIDDEN_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_HOMOGENEOUS_MASK) {
}
}
if (resbmap &
if (resbmap & FATTR4_MAXFILESIZE_MASK) {
}
if (resbmap & FATTR4_MAXLINK_MASK) {
}
if (resbmap & FATTR4_MAXNAME_MASK) {
}
if (resbmap & FATTR4_MAXREAD_MASK) {
}
if (resbmap & FATTR4_MAXWRITE_MASK) {
}
}
if (resbmap &
if (resbmap & FATTR4_MIMETYPE_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_MODE_MASK) {
}
if (resbmap & FATTR4_NO_TRUNC_MASK) {
}
if (resbmap & FATTR4_NUMLINKS_MASK) {
}
}
if (resbmap &
if (resbmap & FATTR4_OWNER_MASK) {
int error;
/* get the OWNER_LENGTH */
/* Manage the owner length location */
*owner_length = ol;
} else {
owner_length = &ol;
}
/* find memory to store the decode */
else
/* Optimize for matching if called for */
if (pug &&
*owner_length) == 0) {
} else {
/*
* String was mapped, but to nobody because
* we are nfsmapid, indicate it should not
* be cached.
*/
error = 0;
garp->n4g_attrwhy =
}
if (error) {
garp->n4g_attrwhy =
} else {
/* save the results for next time */
ol);
}
}
}
}
if (resbmap & FATTR4_OWNER_GROUP_MASK) {
int error;
/* get the OWNER_GROUP_LENGTH */
/* Manage the group length location */
*group_length = gl;
} else {
group_length = ≷
}
/* find memory to store the decode */
else
/* Optimize for matching if called for */
if (pug &&
*group_length) == 0) {
} else {
/*
* String was mapped, but to nobody because
* we are nfsmapid, indicate it should not
* be cached.
*/
error = 0;
garp->n4g_attrwhy =
}
if (error) {
garp->n4g_attrwhy =
} else {
gl);
}
}
}
}
if (resbmap & FATTR4_QUOTA_AVAIL_HARD_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_QUOTA_AVAIL_SOFT_MASK) {
ASSERT(0);
}
}
if (resbmap &
if (resbmap & FATTR4_QUOTA_USED_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_RAWDEV_MASK) {
} else {
}
}
if (resbmap & FATTR4_SPACE_AVAIL_MASK) {
}
if (resbmap & FATTR4_SPACE_FREE_MASK) {
}
if (resbmap & FATTR4_SPACE_TOTAL_MASK) {
}
if (resbmap & FATTR4_SPACE_USED_MASK) {
/* Compute space depending on device type */
} else {
vap->va_nblocks = 0;
}
}
if (resbmap & FATTR4_SYSTEM_MASK) {
ASSERT(0);
}
}
if (resbmap &
if (resbmap & FATTR4_TIME_ACCESS_MASK) {
int error;
if (error) {
}
}
if (resbmap & FATTR4_TIME_ACCESS_SET_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_TIME_BACKUP_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_TIME_CREATE_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_TIME_DELTA_MASK) {
}
if (resbmap & FATTR4_TIME_METADATA_MASK) {
int error;
if (error) {
}
}
if (resbmap & FATTR4_TIME_MODIFY_MASK) {
int error;
if (error) {
}
}
if (resbmap & FATTR4_TIME_MODIFY_SET_MASK) {
ASSERT(0);
}
if (resbmap & FATTR4_MOUNTED_ON_FILEID_MASK) {
}
}
/*
* FATTR4_ACL_MASK is not yet supported by this function, but
* we check against it anyway, in case it ever is.
*/
/* copy only if not provided */
}
}
return (TRUE);
}
/*
* "." and ".." buffers for filling in on read and readdir
* calls. Intialize the first time and fill in on every
* call to to readdir.
*/
char *nfs4_dot_entries;
char *nfs4_dot_dot_entry;
/*
* Create the "." or ".." and pad the buffer once so they are
* copied out as required into the user supplied buffer everytime.
* DIRENT64_RECLEN(sizeof (".") - 1) = DIRENT64_RECLEN(1)
* DIRENT64_RECLEN(sizeof ("..") - 1) = DIRENT64_RECLEN(2)
*/
void
{
/*
* zalloc it so it zeros the buffer out. Need
* to just do it once.
*/
KM_SLEEP);
}
void
{
if (nfs4_dot_entries)
DIRENT64_RECLEN(2));
}
{
int entry_length = 0;
int space_left = 0;
int skip_to_end;
return (FALSE);
return (TRUE);
gar.n4g_change_valid = 0;
gar.n4g_mon_fid_valid = 0;
gar.n4g_fsid_valid = 0;
/* READDIR4res_clnt_free needs to kmem_free this buffer */
/* Fill in dot and dot-dot if needed */
DIRENT64_RECLEN(1));
DIRENT64_RECLEN(2));
} else { /* for ".." entry */
DIRENT64_RECLEN(2));
DIRENT64_RECLEN(2));
}
/* Magic NFSv4 number for entry after start */
last_cookie = 2;
}
/* Get the cookie VERIFIER */
goto noentries;
/* Get the do-we-have-a-next-entry BOOL */
goto noentries;
pug = alloc_ugcache();
skip_to_end = 0;
while (more_data) {
/* Get the COOKIE */
goto noentries;
/* Get the LENGTH of the entry name */
goto noentries;
if (!skip_to_end) {
/*
* With the length of the directory entry name
* in hand, figure out if there is room left
* to encode it for the requestor. If not,
* that is okay, but the rest of the readdir
* operation result must be decoded in the
* case there are following operations
* in the compound request. Therefore, mark
* the rest of the response as "skip" and
* decode or skip the remaining data
*/
if (space_left < entry_length)
skip_to_end = 1;
}
/* Get the NAME of the entry */
if (!skip_to_end) {
goto noentries;
} else {
goto noentries;
}
/* Get the attribute BITMAP */
goto noentries;
/* Get the LENGTH of the attributes */
goto noentries;
/* Get the ATTRIBUTES */
if (!skip_to_end) {
if (!(resbmap & FATTR4_ACL_MASK) &&
!= NULL) {
goto noentries;
} else {
goto noentries;
}
/* Fill in the d_ino per the server's fid values */
/*
* Important to note that the mounted on fileid
* is returned in d_ino if supported. This is
* expected, readdir returns the mounted on fileid
* while stat() returns the fileid of the object
* on "top" of the mount.
*/
if (gar.n4g_mon_fid_valid)
else
/* See about creating an rnode for this entry */
if ((resbmap &
aobjp->t,
}
} else {
goto noentries;
}
/* Get the do-we-have-a-next-entry BOOL */
goto noentries;
}
if (pug) {
}
/*
* Finish up the rddir cache
* If no entries were returned, free up buffer &
* set ncookie to the starting cookie for this
* readdir request so that the direof caching
* will work properly.
*/
if (last_cookie == 0) {
}
/* Get the EOF marker */
goto noentries;
/*
* If the server returns eof and there were no
* skipped entries, set eof
*/
/*
* If we encoded entries we are done
*/
return (TRUE);
}
/*
* If there were no entries and we skipped because
* there was not enough space, return EINVAL
*/
if (skip_to_end) {
return (TRUE);
}
/*
* No entries, nothing skipped, and EOF, return OK.
*/
return (TRUE);
}
/*
* No entries, nothing skipped, and not EOF
* probably a bad cookie, return ENOENT.
*/
return (TRUE);
}
if (pug)
return (FALSE);
}
/*
* xdr_ga_res
*
* Returns: FALSE on raw data processing errors, TRUE otherwise.
*
* This function pre-processes the OP_GETATTR response, and then
* calls common routines to process the GETATTR fattr4 results into
* vnode attributes and other components that the client is interested
* in. If an error other than an RPC error is encountered, the details
* of the error are filled into objp, although the result of the
* processing is set to TRUE.
*/
static bool_t
{
#ifdef INLINE
#endif
/* Initialize objp attribute error values */
return (FALSE);
/* save the response bitmap for the caller */
/* attrlen */
return (FALSE);
/*
* Handle case where request and response bitmaps don't match.
*/
/*
* Return error for case where server sent extra attributes
* because the "unknown" attributes may be anywhere in the
* xdr stream and can't be properly processed.
*/
if (deltabmap) {
return (TRUE);
}
/*
* Return error for case where there is a mandatory
* attribute missing in the server response. Note that
* missing recommended attributes are evaluated in the
* specific routines that decode the server response.
*/
& aobjp->attr_request);
if ((deltabmap & FATTR4_MANDATTR_MASK)) {
return (TRUE);
}
}
/* Check to see if the attrs can be inlined and go for it if so */
#ifdef INLINE
if (!(resbmap & FATTR4_ACL_MASK) &&
else
#endif
}
/*
* We assume that an enum is a 32-bit value, check it once
*/
#endif
{
#endif
return (TRUE);
return (FALSE);
return (TRUE);
/* xdr_nfstime4 */
return (FALSE);
}
static bool_t
{
return (FALSE);
}
/*
* Optimized free case
*/
return (TRUE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
}
static bool_t
{
return (FALSE);
case NF4LNK:
return (FALSE);
break;
case NF4BLK:
case NF4CHR:
return (FALSE);
return (FALSE);
break;
case NF4SOCK:
case NF4FIFO:
case NF4DIR:
default:
break; /* server should return NFS4ERR_BADTYPE */
}
return (FALSE);
}
/*
* Optimized free case
*/
}
}
static bool_t
{
int len;
return (FALSE);
case NF4LNK:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (FALSE);
return (FALSE);
break;
case NF4BLK:
case NF4CHR:
if (!XDR_PUTINT32(xdrs,
return (FALSE);
if (!XDR_PUTINT32(xdrs,
return (FALSE);
break;
case NF4SOCK:
case NF4FIFO:
case NF4DIR:
default:
break; /* server should return NFS4ERR_BADTYPE */
}
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (FALSE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
return (FALSE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
return (FALSE);
return (FALSE);
return (FALSE);
lock_seqid));
}
/*
* Optimized free case
*/
NULL) {
}
}
return (TRUE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (xdr_opaque(xdrs,
}
return (TRUE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
/*
* Optimized free case
*/
return (TRUE);
return (TRUE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
/*
* Optimized free case
*/
return (TRUE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (TRUE);
/* xdr_LOCK4denied */
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
}
/*
* Optimized free case
*/
return (TRUE);
return (TRUE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
/* xdr_open_owner4 */
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
return (FALSE);
/* xdr_openflag4 */
return (FALSE);
/* xdr_createhow4 */
return (FALSE);
case UNCHECKED4:
case GUARDED4:
if (!xdr_fattr4(xdrs,
return (FALSE);
break;
case EXCLUSIVE4:
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
break;
default:
return (FALSE);
}
}
/* xdr_open_claim4 */
return (FALSE);
case CLAIM_NULL:
case CLAIM_PREVIOUS:
case CLAIM_DELEGATE_CUR:
return (FALSE);
return (FALSE);
case CLAIM_DELEGATE_PREV:
default:
return (FALSE);
}
}
/*
* Optimized free case
*/
case UNCHECKED4:
case GUARDED4:
(void) xdr_fattr4(xdrs,
break;
case EXCLUSIVE4:
default:
break;
}
}
case CLAIM_NULL:
return (TRUE);
case CLAIM_PREVIOUS:
return (TRUE);
case CLAIM_DELEGATE_CUR:
NULL) {
}
return (TRUE);
case CLAIM_DELEGATE_PREV:
NULL) {
}
return (TRUE);
default:
return (TRUE);
}
}
static bool_t
{
int op;
int len;
/*
* We must always define the client's open_owner to be
* 4 byte aligned and sized.
*/
int i;
/* xdr_open_owner4 */
/* We know this is very short so don't bcopy */
for (i = 0; i < len; i++)
/* xdr_openflag4 */
} else {
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
/* xdr_open_owner4 */
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
return (FALSE);
return (FALSE);
/* xdr_openflag4 */
return (FALSE);
}
/* xdr_createhow4 */
return (FALSE);
case UNCHECKED4:
case GUARDED4:
if (!xdr_fattr4(xdrs,
return (FALSE);
break;
case EXCLUSIVE4:
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
break;
default:
return (FALSE);
}
}
/* xdr_open_claim4 */
return (FALSE);
case CLAIM_NULL:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (xdr_opaque(xdrs,
}
return (FALSE);
case CLAIM_PREVIOUS:
return (XDR_PUTINT32(xdrs,
case CLAIM_DELEGATE_CUR:
return (FALSE);
return (FALSE);
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (xdr_opaque(xdrs,
len));
}
return (FALSE);
case CLAIM_DELEGATE_PREV:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (xdr_opaque(xdrs,
}
return (FALSE);
default:
return (FALSE);
}
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
return (FALSE);
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
case OPEN_DELEGATE_NONE:
return (TRUE);
case OPEN_DELEGATE_READ:
return (FALSE);
return (FALSE);
return (FALSE);
case OPEN_DELEGATE_WRITE:
return (FALSE);
return (FALSE);
return (FALSE);
limitby))
return (FALSE);
switch (objp->delegation.
limitby) {
case NFS_LIMIT_SIZE:
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
break;
case NFS_LIMIT_BLOCKS:
return (FALSE);
return (FALSE);
break;
default:
return (FALSE);
}
}
return (FALSE);
}
/*
* Optimized free case
*/
return (TRUE);
case OPEN_DELEGATE_NONE:
return (TRUE);
case OPEN_DELEGATE_READ:
case OPEN_DELEGATE_WRITE:
switch (objp->delegation.
case NFS_LIMIT_SIZE:
case NFS_LIMIT_BLOCKS:
break;
default:
return (FALSE);
}
}
return (FALSE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
return (TRUE);
} else {
}
}
/* XDR_DECODE case */
return (TRUE);
}
static bool_t
{
return (FALSE);
/*
* Optimized free case
*/
return (TRUE);
return (TRUE);
}
/* on with ENCODE paths */
return (FALSE);
return (TRUE);
return (FALSE);
return (TRUE);
} else {
return (FALSE);
}
/*
* See xdr_READ3res() for an explanation of why we need
* to do a pullup here.
*/
return (FALSE);
}
} else {
return (FALSE);
}
/*
* If read data sent by wlist (RDMA_WRITE), don't do
* xdr_bytes() below. RDMA_WRITE transfers the data.
* Note: this is encode-only because the client code
* uses xdr_READ4res_clnt to decode results.
*/
return (xdrrdma_send_read_data(
}
return (TRUE);
}
}
}
static bool_t
{
size_t n;
int error;
return (FALSE);
/*
* Optimized free case
*/
return (TRUE);
return (TRUE);
}
return (FALSE);
return (TRUE);
return (FALSE);
/*
* This is a special case such that the caller is providing a
* uio as a guide to eventual data location; this is used for
* handling DIRECTIO reads.
*/
return (FALSE);
return (TRUE);
return (FALSE);
do {
if (error)
return (FALSE);
size -= n;
}
return (TRUE);
}
/* opaque count */
return (FALSE);
}
int, ocount,
return (FALSE);
}
return (TRUE);
}
}
/*
* This isn't an xdrmblk stream nor RDMA.
* Handle the likely case that it can be
* inlined (ex. xdrmem).
*/
return (FALSE);
return (TRUE);
return (FALSE);
/*
* Handle some other (unlikely) stream type that will
* need a copy.
*/
return (FALSE);
return (FALSE);
}
}
/*
* Check for the other special case of the caller providing
* the target area for the data.
*/
return (FALSE);
/*
* If read data received via RDMA_WRITE, don't do xdr_bytes().
* RDMA_WRITE already moved the data so decode length of
* RDMA_WRITE.
*/
/*
* Data transferred through inline if
* objp->wlist == NULL
*/
/* opaque count */
return (FALSE);
}
int, ocount,
return (FALSE);
}
return (TRUE);
}
}
aobjp->res_maxsize));
}
static bool_t
{
}
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
{
return (FALSE);
return (TRUE);
return (FALSE);
== TRUE) {
/* mblk successfully inserted into outgoing chain */
return (TRUE);
}
}
/*
* If transport is RDMA, the pre-encoded m_blk needs to be moved
* without being chunked.
* Check if chunking is enabled for the xdr stream.
* If it is enabled, disable it temporarily for this op,
* then re-enable.
*/
if (!(flags & XDR_RDMA_CHUNK))
flags &= ~XDR_RDMA_CHUNK;
flags |= XDR_RDMA_CHUNK;
return (ret_val);
}
static bool_t
{
return (FALSE);
return (TRUE);
}
/*
* Optimized free case
*/
return (TRUE);
return (TRUE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
return (FALSE);
return (xdr_u_longlong_t(xdrs,
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
return (FALSE);
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
return (xdr_u_longlong_t(xdrs,
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
return (FALSE);
}
/*
* Optimized free path
*/
return (TRUE);
return (TRUE);
}
static bool_t
{
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
/*
* Optimized free case
*/
}
static bool_t
{
return (FALSE);
case NFS4_OK:
if (!xdr_u_longlong_t(xdrs,
clientid))
return (FALSE);
return (xdr_u_longlong_t(xdrs,
case NFS4ERR_CLID_INUSE:
if (!xdr_string(xdrs,
return (FALSE);
return (xdr_string(xdrs,
}
return (TRUE);
}
/*
* Optimized free case
*/
return (TRUE);
return (FALSE);
}
static bool_t
{
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
int retval;
return (FALSE);
}
}
/* Else fall thru for the xdr_bytes(). */
}
return (TRUE);
}
/*
* Optimized free case
*/
return (TRUE);
}
static bool_t
{
return (FALSE);
return (TRUE);
return (FALSE);
return (FALSE);
return (xdr_u_longlong_t(xdrs,
}
static bool_t
{
int i;
/*
* Optimized XDR_FREE only args array
*/
/*
* Nothing to do?
*/
return (TRUE);
for (i = 0; i < len; i++) {
/*
* These should be ordered by frequency of use
*/
case OP_PUTFH: {
}
continue;
}
case OP_GETATTR:
case OP_GETFH:
continue;
case OP_LOOKUP:
utf8string_val != NULL) {
}
continue;
case OP_OPEN:
(void) xdr_OPEN4args(xdrs,
continue;
case OP_CLOSE:
case OP_ACCESS:
case OP_READ:
continue;
case OP_WRITE:
(void) xdr_WRITE4args(xdrs,
continue;
case OP_DELEGRETURN:
case OP_LOOKUPP:
case OP_READDIR:
continue;
case OP_REMOVE:
utf8string_val != NULL) {
}
continue;
case OP_COMMIT:
continue;
case OP_CREATE:
(void) xdr_CREATE4args(xdrs,
continue;
case OP_DELEGPURGE:
continue;
case OP_LINK:
utf8string_val != NULL) {
}
continue;
case OP_LOCK:
(void) xdr_LOCK4args(xdrs,
continue;
case OP_LOCKT:
(void) xdr_LOCKT4args(xdrs,
continue;
case OP_LOCKU:
continue;
case OP_NVERIFY:
(void) xdr_fattr4(xdrs,
continue;
case OP_OPENATTR:
case OP_OPEN_CONFIRM:
case OP_OPEN_DOWNGRADE:
case OP_PUTPUBFH:
case OP_PUTROOTFH:
case OP_READLINK:
continue;
case OP_RENAME:
utf8string_val != NULL) {
}
utf8string_val != NULL) {
}
continue;
case OP_RENEW:
case OP_RESTOREFH:
case OP_SAVEFH:
continue;
case OP_SECINFO:
utf8string_val != NULL) {
}
continue;
case OP_SETATTR:
(void) xdr_fattr4(xdrs,
continue;
case OP_SETCLIENTID:
(void) xdr_SETCLIENTID4args(xdrs,
continue;
case OP_SETCLIENTID_CONFIRM:
continue;
case OP_VERIFY:
(void) xdr_fattr4(xdrs,
continue;
case OP_RELEASE_LOCKOWNER:
array[i].nfs_argop4_u.
}
continue;
case OP_ILLEGAL:
continue;
default:
/*
* An invalid op is a coding error, it should never
* have been decoded.
* Don't error because the caller cannot finish
* freeing the residual memory of the array.
*/
continue;
}
}
return (TRUE);
}
static bool_t
{
/*
* These should be ordered by frequency of use
*/
case OP_PUTFH:
NFS4_FHSIZE));
case OP_GETATTR:
/*
* ACLs can become relatively large ( > 8K) and the default
* 8K reply chunk of RDMA may not suffice. Check for
* get ACL bit and if it's RDMA, add a chunk equal the size
* of the transfer size to the reply chunk list.
*/
FATTR4_ACL_MASK)) {
}
return (xdr_bitmap4(xdrs,
case OP_GETFH:
return (TRUE);
case OP_LOOKUP:
case OP_OPEN:
case OP_CLOSE:
case OP_ACCESS:
case OP_READ:
case OP_WRITE:
case OP_DELEGRETURN:
return (FALSE);
return (xdr_opaque(xdrs,
case OP_LOOKUPP:
return (TRUE);
case OP_READDIR:
case OP_REMOVE:
case OP_COMMIT:
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
case OP_CREATE:
case OP_DELEGPURGE:
return (xdr_u_longlong_t(xdrs,
case OP_LINK:
case OP_LOCK:
case OP_LOCKT:
case OP_LOCKU:
case OP_NVERIFY:
return (xdr_fattr4(xdrs,
case OP_OPENATTR:
case OP_OPEN_CONFIRM:
return (FALSE);
return (FALSE);
seqid));
case OP_OPEN_DOWNGRADE:
return (xdr_OPEN_DOWNGRADE4args(xdrs,
case OP_PUTPUBFH:
return (TRUE);
case OP_PUTROOTFH:
return (TRUE);
case OP_READLINK:
}
return (TRUE);
case OP_RENAME:
return (FALSE);
case OP_RENEW:
return (xdr_u_longlong_t(xdrs,
case OP_RESTOREFH:
return (TRUE);
case OP_SAVEFH:
return (TRUE);
case OP_SECINFO:
case OP_SETATTR:
return (FALSE);
return (FALSE);
case OP_SETCLIENTID:
return (xdr_SETCLIENTID4args(xdrs,
case OP_SETCLIENTID_CONFIRM:
return (FALSE);
return (xdr_u_longlong_t(xdrs,
case OP_VERIFY:
return (xdr_fattr4(xdrs,
case OP_RELEASE_LOCKOWNER:
if (!xdr_u_longlong_t(xdrs,
return (FALSE);
case OP_ILLEGAL:
return (TRUE);
}
return (FALSE);
}
static bool_t
{
return (FALSE);
}
static bool_t
{
return (FALSE);
case OP_PUTFH:
return (xdr_decode_nfs_fh4(xdrs,
default:
}
}
/*
* Client side encode only arg op processing
*/
static bool_t
{
int len;
int op;
/*
* Special case the private pseudo ops
*/
/*
* These should be ordered by frequency of use
*/
case OP_CPUTFH:
/*
* We are passed in the file handle as a nfs4_sharedfh_t *
* We need to acquire the correct locks so we can copy it out.
*/
/*
* First try and inline the copy
* Must first be a multiple of BYTES_PER_XDR_UNIT
*/
if (!(len % BYTES_PER_XDR_UNIT) &&
NULL) {
return (TRUE);
}
return (FALSE);
}
return (FALSE);
}
if (!(len % BYTES_PER_XDR_UNIT)) {
return (TRUE);
}
return (TRUE);
}
return (FALSE);
case OP_CLOOKUP:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (xdr_opaque(xdrs,
len));
}
}
return (FALSE);
case OP_COPEN:
/* op processing inlined in xdr_OPEN4cargs */
case OP_CREMOVE:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (xdr_opaque(xdrs,
len));
}
}
return (FALSE);
case OP_CCREATE:
return (FALSE);
case OP_CLINK:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (xdr_opaque(xdrs,
len));
}
}
return (FALSE);
case OP_CRENAME:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (FALSE);
return (FALSE);
if (!xdr_opaque(xdrs,
return (FALSE);
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
return (xdr_opaque(xdrs,
}
return (FALSE);
case OP_CSECINFO:
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
op = OP_SECINFO;
return (xdr_opaque(xdrs,
len));
}
}
return (FALSE);
}
return (FALSE);
}
/*
* Note that the len and decode_len will only be different in the case
* of the client's use of this free function. If the server is
* freeing results, then the len/decode_len will always match.
*/
static bool_t
{
int i;
/*
* Optimized XDR_FREE only results array
*/
return (TRUE);
for (i = 0; i < decode_len; i++) {
/*
* These should be ordered by frequency of use
*/
case OP_PUTFH:
continue;
case OP_GETATTR:
continue;
if (gr->n4g_ext_res) {
(void) xdr_fattr4_fs_locations(xdrs,
sizeof (struct nfs4_ga_ext_res));
}
continue;
case OP_GETFH:
continue;
NULL) {
}
continue;
case OP_LOOKUP:
continue;
case OP_OPEN:
opopen);
continue;
case OP_CLOSE:
case OP_ACCESS:
continue;
case OP_READ:
(void) xdr_READ4res(xdrs,
continue;
case OP_WRITE:
case OP_DELEGRETURN:
case OP_LOOKUPP:
case OP_READDIR:
case OP_REMOVE:
case OP_COMMIT:
case OP_CREATE:
case OP_DELEGPURGE:
case OP_LINK:
continue;
case OP_LOCK:
oplock);
continue;
case OP_LOCKT:
oplockt);
continue;
case OP_LOCKU:
case OP_NVERIFY:
case OP_OPENATTR:
case OP_OPEN_CONFIRM:
case OP_OPEN_DOWNGRADE:
case OP_PUTPUBFH:
case OP_PUTROOTFH:
case OP_RENAME:
case OP_RENEW:
case OP_RESTOREFH:
case OP_SAVEFH:
continue;
case OP_READLINK:
continue;
case OP_SECINFO:
continue;
case OP_SETCLIENTID:
(void) xdr_SETCLIENTID4res(xdrs,
continue;
case OP_SETATTR:
case OP_SETCLIENTID_CONFIRM:
case OP_VERIFY:
case OP_RELEASE_LOCKOWNER:
case OP_ILLEGAL:
continue;
default:
/*
* An invalid op is a coding error, it should never
* have been decoded.
* Don't error because the caller cannot finish
* freeing the residual memory of the array.
*/
continue;
}
}
return (TRUE);
}
static bool_t
{
}
static bool_t
{
/*
* These should be ordered by frequency of use
*/
case OP_PUTFH:
case OP_GETATTR:
return (FALSE);
return (TRUE);
return (xdr_fattr4(xdrs,
case OP_GETFH:
return (FALSE);
return (TRUE);
NFS4_FHSIZE));
case OP_LOOKUP:
case OP_OPEN:
case OP_CLOSE:
case OP_ACCESS:
case OP_READ:
case OP_WRITE:
case OP_DELEGRETURN:
case OP_LOOKUPP:
case OP_READDIR:
case OP_REMOVE:
case OP_COMMIT:
return (FALSE);
return (TRUE);
return (xdr_u_longlong_t(xdrs,
writeverf));
case OP_CREATE:
case OP_DELEGPURGE:
case OP_LINK:
case OP_LOCK:
case OP_LOCKT:
case OP_LOCKU:
return (FALSE);
return (TRUE);
return (FALSE);
return (xdr_opaque(xdrs,
case OP_NVERIFY:
case OP_OPENATTR:
case OP_OPEN_CONFIRM:
return (xdr_OPEN_CONFIRM4res(xdrs,
case OP_OPEN_DOWNGRADE:
return (xdr_OPEN_DOWNGRADE4res(xdrs,
case OP_PUTPUBFH:
case OP_PUTROOTFH:
case OP_READLINK:
case OP_RENAME:
case OP_RENEW:
case OP_RESTOREFH:
case OP_SAVEFH:
case OP_SECINFO:
status))
return (FALSE);
return (TRUE);
NFS4_SECINFO_LIMIT, sizeof (secinfo4),
case OP_SETATTR:
status))
return (FALSE);
return (xdr_bitmap4(xdrs,
case OP_SETCLIENTID:
return (xdr_SETCLIENTID4res(xdrs,
case OP_SETCLIENTID_CONFIRM:
status));
case OP_VERIFY:
case OP_RELEASE_LOCKOWNER:
case OP_ILLEGAL:
}
return (FALSE);
}
static bool_t
{
return (FALSE);
case OP_GETFH:
if (!XDR_PUTINT32(xdrs,
return (FALSE);
return (TRUE);
return (xdr_encode_nfs_fh4(xdrs,
default:
}
}
static bool_t
{
return (FALSE);
/*
* These should be ordered by frequency of use
*/
case OP_PUTFH:
case OP_GETATTR:
return (FALSE);
return (TRUE);
return (xdr_ga_res(xdrs,
case OP_GETFH:
return (FALSE);
return (TRUE);
NFS4_FHSIZE));
case OP_LOOKUP:
case OP_NVERIFY:
case OP_OPEN:
case OP_CLOSE:
case OP_ACCESS:
case OP_READ:
case OP_WRITE:
case OP_DELEGRETURN:
case OP_LOOKUPP:
case OP_READDIR:
return (xdr_READDIR4res_clnt(xdrs,
case OP_REMOVE:
case OP_COMMIT:
return (FALSE);
return (TRUE);
return (xdr_u_longlong_t(xdrs,
writeverf));
case OP_CREATE:
case OP_DELEGPURGE:
case OP_LINK:
case OP_LOCK:
case OP_LOCKT:
case OP_LOCKU:
return (FALSE);
return (TRUE);
return (FALSE);
return (xdr_opaque(xdrs,
case OP_OPENATTR:
case OP_OPEN_CONFIRM:
return (xdr_OPEN_CONFIRM4res(xdrs,
case OP_OPEN_DOWNGRADE:
return (xdr_OPEN_DOWNGRADE4res(xdrs,
case OP_PUTPUBFH:
case OP_PUTROOTFH:
case OP_READLINK:
case OP_RENAME:
case OP_RENEW:
case OP_RESTOREFH:
case OP_SAVEFH:
case OP_SECINFO:
status))
return (FALSE);
return (TRUE);
case OP_SETATTR:
status))
return (FALSE);
return (xdr_bitmap4(xdrs,
case OP_SETCLIENTID:
return (xdr_SETCLIENTID4res(xdrs,
case OP_SETCLIENTID_CONFIRM:
status));
case OP_VERIFY:
case OP_RELEASE_LOCKOWNER:
case OP_ILLEGAL:
}
return (FALSE);
}
{
/*
* XDR_ENCODE only
*/
return (TRUE);
return (FALSE);
/*
* Efficiently encode fixed length tags, could be longlongs
* but 8 byte XDR alignment not assured
*/
/*
* Fixed minor version for now
*/
} else {
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
}
}
}
{
return (FALSE);
return (FALSE);
}
{
/*
* No XDR_ENCODE
*/
return (FALSE);
} else {
return (FALSE);
return (FALSE);
}
if (len > NFS4_MAX_UTF8STRING)
return (FALSE);
/*
* Ignore the tag
*/
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
/* Alloc the results array */
objp->decode_len = 0;
/*
* Make sure to free anything that may
* have been allocated along the way.
*/
objp->decode_len);
return (FALSE);
}
}
return (TRUE);
}
}
{
return (FALSE);
return (FALSE);
}
/*
* NFS server side callback, initiating the callback request so it
* is the RPC client. Must convert from server's internal filehandle
* format to wire format.
*/
static bool_t
{
return (FALSE);
case OP_CB_GETATTR:
return (FALSE);
case OP_CB_RECALL:
return (FALSE);
return (FALSE);
return (FALSE);
case OP_CB_ILLEGAL:
return (TRUE);
}
return (FALSE);
}
/*
* NFS client side callback, receiving the callback request so it
* is the RPC server. Must treat the file handles as opaque.
*/
static bool_t
{
return (FALSE);
case OP_CB_GETATTR:
return (FALSE);
case OP_CB_RECALL:
return (FALSE);
return (FALSE);
return (FALSE);
case OP_CB_ILLEGAL:
return (TRUE);
}
return (FALSE);
}
static bool_t
{
return (FALSE);
case OP_CB_GETATTR:
status))
return (FALSE);
return (TRUE);
return (xdr_fattr4(xdrs,
case OP_CB_RECALL:
case OP_CB_ILLEGAL:
}
return (FALSE);
}
/*
* The NFS client side callback, RPC server
*/
{
return (FALSE);
return (FALSE);
return (FALSE);
}
/*
* The NFS server side callback, RPC client
*/
{
return (FALSE);
return (FALSE);
return (FALSE);
}
{
return (FALSE);
return (FALSE);
}