/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
void rfs4_init_compound_state(struct compound_state *);
/* If building with DEBUG enabled, enable mandattr tunable by default */
#ifdef DEBUG
#ifndef RFS4_SUPPORT_MANDATTR_ONLY
#define RFS4_SUPPORT_MANDATTR_ONLY
#endif
#endif
/*
* If building with mandattr only code, disable it by default.
* When building without mandattr ifdef, the compiler should
* optimize away the the comparisons because RFS4_MANDATTR_ONLY
* is defined to be 0.
*/
#ifdef RFS4_SUPPORT_MANDATTR_ONLY
int rfs4_mandattr_only = 0;
#else
#define RFS4_MANDATTR_ONLY 0
#endif
static void rfs4_ntov_init(void);
static int rfs4_fattr4_supported_attrs();
static int rfs4_fattr4_type();
static int rfs4_fattr4_fh_expire_type();
static int rfs4_fattr4_change();
static int rfs4_fattr4_size();
static int rfs4_fattr4_link_support();
static int rfs4_fattr4_symlink_support();
static int rfs4_fattr4_named_attr();
static int rfs4_fattr4_fsid();
static int rfs4_fattr4_unique_handles();
static int rfs4_fattr4_lease_time();
static int rfs4_fattr4_rdattr_error();
static int rfs4_fattr4_acl();
static int rfs4_fattr4_aclsupport();
static int rfs4_fattr4_archive();
static int rfs4_fattr4_cansettime();
static int rfs4_fattr4_case_insensitive();
static int rfs4_fattr4_case_preserving();
static int rfs4_fattr4_chown_restricted();
static int rfs4_fattr4_filehandle();
static int rfs4_fattr4_fileid();
static int rfs4_fattr4_files_avail();
static int rfs4_fattr4_files_free();
static int rfs4_fattr4_files_total();
static int rfs4_fattr4_fs_locations();
static int rfs4_fattr4_hidden();
static int rfs4_fattr4_homogeneous();
static int rfs4_fattr4_maxfilesize();
static int rfs4_fattr4_maxlink();
static int rfs4_fattr4_maxname();
static int rfs4_fattr4_maxread();
static int rfs4_fattr4_maxwrite();
static int rfs4_fattr4_mimetype();
static int rfs4_fattr4_mode();
static int rfs4_fattr4_no_trunc();
static int rfs4_fattr4_numlinks();
static int rfs4_fattr4_owner();
static int rfs4_fattr4_owner_group();
static int rfs4_fattr4_quota_avail_hard();
static int rfs4_fattr4_quota_avail_soft();
static int rfs4_fattr4_quota_used();
static int rfs4_fattr4_rawdev();
static int rfs4_fattr4_space_avail();
static int rfs4_fattr4_space_free();
static int rfs4_fattr4_space_total();
static int rfs4_fattr4_space_used();
static int rfs4_fattr4_system();
static int rfs4_fattr4_time_access();
static int rfs4_fattr4_time_access_set();
static int rfs4_fattr4_time_backup();
static int rfs4_fattr4_time_create();
static int rfs4_fattr4_time_delta();
static int rfs4_fattr4_time_metadata();
static int rfs4_fattr4_time_modify();
static int rfs4_fattr4_time_modify_set();
/*
* Initialize the supported attributes
*/
void
{
int i;
/*
* Get all the supported attributes
*/
rfs4_supported_attrs = 0;
for (i = 0; i < NFS4_MAXNUM_ATTRS; i++) {
#ifdef RFS4_SUPPORT_MANDATTR_ONLY
continue;
#endif
}
}
}
/*
* The following rfs4_fattr4_* functions convert between the fattr4
* arguments/attributes and the system (e.g. vattr) values. The following
* commands are currently in use:
*
* NFS4ATTR_SUPPORTED: checks if the attribute in question is supported:
* sarg.op = SUPPORTED - all supported attrs
* sarg.op = GETIT - only supported readable attrs
* sarg.op = SETIT - only supported writable attrs
*
* NFS4ATTR_GETIT: getattr type conversion - convert system values
* (e.g. vattr struct) to fattr4 type values to be returned to the
* user - usually in response to nfsv4 getattr request.
*
* NFS4ATTR_SETIT: convert fattr4 type values to system values to use by
* even if not supported by the filesystem. Note that ufs only allows setattr
*
* NFS4ATTR_VERIT: convert fattr4 type values to system values to use by
* almost everything that can be returned by getattr into known structs
* The function will return -1 if it found that the arguments don't match.
* This applies to system-wide values that don't require a VOP_GETATTR
* or other further checks to verify. It will return no error if they
* either match or were retrieved successfully for later checking.
*
* NFS4ATTR_FREEIT: free up any space allocated by either of the above.
* The sargp->op should be either NFS4ATTR_GETIT or NFS4ATTR_SETIT
* to indicate which op was used to allocate the space.
*
* XXX Note: these functions are currently used by the server only. A
* XXX different method of conversion is used on the client side.
* XXX Eventually combining the two (possibly by adding NFS4ATTR_CLNT_GETIT
* XXX and SETIT) may be a cleaner approach.
*/
/*
* Mandatory attributes
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
/*
* Compare the input bitmap to the server's bitmap
*/
}
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/*
* Translate vnode vtype to nfsv4_ftype.
*/
};
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
/*
* if xattr flag not set, use v4_to_nf4 mapping;
* otherwise verify xattr flag is in sync with va_type
* and set xattr types.
*/
else {
/*
* FH4 flag was set. Dir type maps to attrdir,
* and all other types map to namedattr.
*/
else
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
/*
* Compare the input type to the object type on server
*/
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
{
#ifdef VOLATILE_FH_TEST
int ex_flags;
return (ESTALE);
== 0) {
return (0);
}
*fh_expire_typep = 0;
if (ex_flags & EX_NOEXPOPEN) {
/* file handles should not expire with open - not used */
}
/*
* file handles may expire any time - on share here.
* If volatile any, no need to check other flags.
*/
return (0);
}
/* file handles may expire on rename */
}
/* file handles may expire on migration - not used */
}
#else /* not VOLATILE_FH_TEST */
#endif /* VOLATILE_FH_TEST */
return (0);
}
/*
* At this point the only volatile filehandles we allow (for test purposes
* only) are either fh's that expire when the filesystem is shared (reshared),
* fh's that expire on a rename and persistent ones.
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
&na->fh_expire_type);
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
static int
{
return (-1); /* may be okay if rdattr_error */
}
}
}
return (0);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
error = -1;
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/*
* XXX - need VOP extension to ask file system (e.g. pcfs) if it supports
* hard links.
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (!na->link_support)
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/*
* XXX - need VOP extension to ask file system (e.g. pcfs) if it supports
* sym links.
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (!na->symlink_support)
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
/*
* Solaris xattr model requires that VFS_XATTR is set
* in file systems enabled for generic xattr. If VFS_XATTR
* not set, no need to call pathconf for _PC_XATTR_EXISTS..
*
* However the VFS_XATTR flag doesn't indicate sysattr support
* so always check for sysattrs and then only do the
* _PC_XATTR_EXISTS pathconf if needed.
*/
val = 0;
if (error)
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (error)
break;
} else
val = 0;
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
/*
* fsid_t is 64bits so it fits completely in fattr4_fsid.major.
* fattr4_fsid.minor is always set to 0 since it isn't needed (yet).
*/
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
if (sarg->is_referral) {
} else {
}
break;
case NFS4ATTR_SETIT:
break;
case NFS4ATTR_VERIT:
if (sarg->is_referral) {
error = -1;
error = -1;
} else {
error = -1;
}
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
/*
* XXX
* For now, we can't support this. Problem of /export, beinging
* a file system, /export/a and /export/b shared separately,
* and /export/a/l and /export/b/l are ahrd links of each other.
*/
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (na->unique_handles)
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
case NFS4ATTR_VERIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/*
* Server side compare of a filehandle from the wire to a native
* server filehandle.
*/
static int
{
return (1);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
switch (cmd) {
case NFS4ATTR_SUPPORTED:
return (EINVAL);
return (0); /* this attr is supported */
case NFS4ATTR_GETIT:
/*
* If sarg->cs->fh is all zeros then should makefh a new
* one, otherwise, copy that one over.
*/
return (-1); /* okay if rdattr_error */
}
return (0);
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
return (EINVAL);
case NFS4ATTR_VERIT:
/*
* A verify of a filehandle will have the client sending
* the raw format which needs to be compared to the
* native format.
*/
return (-1); /* no match */
return (0);
case NFS4ATTR_FREEIT:
return (0);
return (0);
return (0);
}
return (0);
}
/*
* Recommended attributes
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break;
case NFS4ATTR_VERIT:
case NFS4ATTR_GETIT:
return (-1);
}
/* see which ACLs fs supports */
if (error != 0) {
/*
* If we got an error, then the filesystem
* likely does not understand the _PC_ACL_ENABLED
* pathconf. In this case, we fall back to trying
* POSIX-draft (aka UFS-style) ACLs, since that's
* the behavior used by earlier version of NFS.
*/
error = 0;
}
/*
* If the file system supports neither ACE nor
* ACLENT ACLs we will fall back to UFS-style ACLs
* like we did above if there was an error upon
* calling VOP_PATHCONF.
*
* ACE and ACLENT type ACLs are the only interfaces
* supported thus far. If any other bits are set on
* 'whichacl' upon return from VOP_PATHCONF, we will
* ignore them.
*/
}
if (whichacl & _ACL_ACE_ENABLED)
else if (whichacl & _ACL_ACLENT_ENABLED)
if (error != 0)
break;
/* get the ACL, and translate it into nfsace4 style */
if (error != 0)
break;
if (whichacl & _ACL_ACE_ENABLED) {
} else {
}
if (error != 0)
break;
if (cmd == NFS4ATTR_GETIT) {
/* see case NFS4ATTR_FREEIT for this being freed */
} else {
vs_ace4.vsa_aclcnt) != 0)
}
break;
case NFS4ATTR_SETIT:
return (-1);
}
/* prepare vs_ace4 from fattr4 data */
}
/* see which ACLs the fs supports */
if (error != 0) {
/*
* If we got an error, then the filesystem
* likely does not understand the _PC_ACL_ENABLED
* pathconf. In this case, we fall back to trying
* POSIX-draft (aka UFS-style) ACLs, since that's
* the behavior used by earlier version of NFS.
*/
error = 0;
}
/*
* If the file system supports neither ACE nor
* ACLENT ACLs we will fall back to UFS-style ACLs
* like we did above if there was an error upon
* calling VOP_PATHCONF.
*
* ACE and ACLENT type ACLs are the only interfaces
* supported thus far. If any other bits are set on
* 'whichacl' upon return from VOP_PATHCONF, we will
* ignore them.
*/
}
if (whichacl & _ACL_ACE_ENABLED) {
if (error != 0)
break;
} else if (whichacl & _ACL_ACLENT_ENABLED) {
if (error != 0)
break;
}
break;
case NFS4ATTR_FREEIT:
}
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
break;
case NFS4ATTR_VERIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (!na->cansettime)
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/*
* XXX - need VOP extension to ask file system (e.g. pcfs) if it supports
* case insensitive.
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (!na->case_insensitive)
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (!na->case_preserving)
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* fattr4_chown_restricted should reall be fattr4_chown_allowed */
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
if (error)
break;
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (error)
break;
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
{
int error = 0;
/* VROOT object, must untraverse */
/* extra hold for vp since untraverse might rele */
/*
* root because untraverse returned same vp
* for a VROOT object. sarg->vap was setup
* before we got here, so there's no need to do
* another getattr -- just use the one in sarg.
*/
} else {
}
/*
* Done with stub, time to rele. If vp and stubvp
* were the same, then we need to rele either vp or
* stubvp. If they weren't the same, then untraverse()
* already took case of the extra hold on vp, and only
* the stub needs to be rele'd. Both cases are handled
* by unconditionally rele'ing the stub.
*/
} else
/*
* At this point, vap should contain "correct" AT_NODEID --
* (for V_ROOT case, nodeid of stub, for non-VROOT case,
* nodeid of vp). If error or AT_NODEID not available, then
* make the obligatory (yet mysterious) rdattr_error
* check that is so common in the attr code.
*/
} else if (sarg->rdattr_error)
error = -1;
/*
* error describes these cases:
* 0 : success
* -1: failure due to previous attr processing error (rddir only).
* * : new attr failure (if rddir, caller will set rdattr_error)
*/
return (error);
}
/* ARGSUSED */
static int
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
case NFS4ATTR_VERIT:
if (! sarg->mntdfid_set)
if (cmd == NFS4ATTR_GETIT)
else
if (na->mounted_on_fileid !=
error = -1;
}
break;
case NFS4ATTR_SETIT:
/* read-only attr */
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
static void
{
int i, len;
return;
utf8s->utf8string_len == 0)
continue;
}
pn4->pathname4_val = 0;
}
static void
{
return;
}
void
{
int i, len;
return;
/* free fs_root */
return;
/* free fs_location4 */
for (i = 0; i < len; i++) {
fsl4++;
}
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
sizeof (fs_locations4));
else {
}
break;
case NFS4ATTR_FREEIT:
break;
case NFS4ATTR_SETIT:
case NFS4ATTR_VERIT:
/*
* read-only attr
*/
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (!na->homogeneous)
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
if (error)
break;
/*
* If the underlying file system does not support
* _PC_FILESIZEBITS, return a reasonable default. Note that
* error code on VOP_PATHCONF will be 0, even if the underlying
* file system does not support _PC_FILESIZEBITS.
*/
} else {
else
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (error)
break;
/*
* If the underlying file system does not support
* _PC_FILESIZEBITS, return a reasonable default. Note that
* error code on VOP_PATHCONF will be 0, even if the underlying
* file system does not support _PC_FILESIZEBITS.
*/
} else {
else
}
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
if (error == 0) {
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
if (error == 0) {
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* If the filesystem is exported with nosuid, then mask off
* the setuid and setgid bits.
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
/*
* There are well defined polices for what happens on server-
* side GETATTR when uid to attribute string conversion cannot
* occur. Please refer to nfs4_idmap.c for details.
*/
switch (error) {
case ECONNREFUSED:
break;
default:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* There are well defined policies for what happens on server-
* side SETATTR of 'owner' when a "user@domain" mapping cannot
* occur. Please refer to nfs4_idmap.c for details.
*
* Any other errors, such as the mapping not being found by
* nfsmapid(1m), and interrupted clnt_call, etc, will result
* in NFS4ERR_BADOWNER.
*
* XXX need to return consistent errors, perhaps all
* server side attribute routines should return NFS4ERR*.
*/
switch (error) {
case NFS4_OK:
case ENOTSUP:
/*
* Ignore warning that we are the
* nfsmapid (can't happen on srv)
*/
error = 0;
break;
case ECOMM:
case ECONNREFUSED:
if (!MSG_PRT_DEBUG) {
/*
* printed just once per daemon death,
* inform the user and then stay silent
*/
"nfsmapid");
}
break;
case EINVAL:
break;
default:
break;
}
break;
case NFS4ATTR_VERIT:
/*
* Ignore warning that we are the nfsmapid (can't happen on srv)
*/
error = 0;
if (error)
break;
case NFS4ATTR_FREEIT:
}
}
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
/*
* There are well defined polices for what happens on server-
* side GETATTR when gid to attribute string conversion cannot
* occur. Please refer to nfs4_idmap.c for details.
*/
TRUE);
switch (error) {
case ECONNREFUSED:
break;
default:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* There are well defined policies for what happens on server-
* side SETATTR of 'owner_group' when a "group@domain" mapping
* cannot occur. Please refer to nfs4_idmap.c for details.
*
* Any other errors, such as the mapping not being found by
* nfsmapid(1m), and interrupted clnt_call, etc, will result
* in NFS4ERR_BADOWNER.
*
* XXX need to return consistent errors, perhaps all
* server side attribute routines should return NFS4ERR*.
*/
TRUE);
switch (error) {
case NFS4_OK:
case ENOTSUP:
/*
* Ignore warning that we are the
* nfsmapid (can't happen on srv)
*/
error = 0;
break;
case ECOMM:
case ECONNREFUSED:
if (!MSG_PRT_DEBUG) {
/*
* printed just once per daemon death,
* inform the user and then stay silent
*/
"nfsmapid");
}
break;
case EINVAL:
break;
default:
break;
}
break;
case NFS4ATTR_VERIT:
/*
* Ignore warning that we are the nfsmapid (can't happen on srv)
*/
error = 0;
if (error)
break;
case NFS4ATTR_FREEIT:
sizeof (na->owner_group));
}
}
break;
}
return (error);
}
/* XXX - quota attributes should be supportable on Solaris 2 */
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
na->space_avail =
} else {
na->space_avail =
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
na->space_free =
} else {
na->space_free =
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
na->space_total =
} else {
na->space_total =
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (error)
break;
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/*
* XXX - need to support the setting of access time
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
case NFS4ATTR_VERIT:
/*
* write only attr
*/
break;
case NFS4ATTR_SETIT:
/*
* Set access time (by server or by client)
*/
} else {
}
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
return (ENOTSUP);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
case NFS4ATTR_SETIT:
/*
* write only attr
*/
break;
case NFS4ATTR_VERIT:
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
&na->time_metadata);
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (error)
break;
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
break;
}
break;
case NFS4ATTR_SETIT:
/*
* read-only attr
*/
break;
case NFS4ATTR_VERIT:
if (error)
break;
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
/*
* XXX - need to add support for setting modify time
*/
/* ARGSUSED */
static int
union nfs4_attr_u *na)
{
int error = 0;
if (RFS4_MANDATTR_ONLY)
return (ENOTSUP);
switch (cmd) {
case NFS4ATTR_SUPPORTED:
break; /* this attr is supported */
case NFS4ATTR_GETIT:
case NFS4ATTR_VERIT:
/*
* write only attr
*/
break;
case NFS4ATTR_SETIT:
/*
* Set modify time (by server or by client)
*/
} else {
}
break;
case NFS4ATTR_FREEIT:
break;
}
return (error);
}
static void
rfs4_ntov_init(void)
{
/* index must be same as corresponding FATTR4_* define */
}