/*
* 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 2011, 2012 Nexenta Systems, Inc. All rights reserved.
* Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
* This is the loadable module wrapper.
*/
#include <nfs/nfs_clnt.h>
/*
* The global tag list.
*/
/*
* The NFS Version 4 client VFS.
*/
"nfs4",
};
"network filesystem version 4",
&vfw4
};
int
nfs4tsize(void)
{
/*
* For the moment, just return nfs4_max_transfer_size until we
* can query the appropriate transport.
*/
return (nfs4_max_transfer_size);
}
{
return (nfs4_max_transfer_size_cots);
return (nfs4_max_transfer_size_rdma);
return (nfs4_max_transfer_size);
}
{
return (nfs4_max_transfer_size_cots);
return (nfs4_max_transfer_size_rdma);
return (nfs4_max_transfer_size);
}
int
{
int flags;
#ifdef lint
#endif
/*
* Set option fields in mount info record
*/
if (flags & NFSMNT_NOAC) {
}
if (flags & NFSMNT_NOCTO)
if (flags & NFSMNT_LLOCK)
if (flags & NFSMNT_GRPID)
if (flags & NFSMNT_RETRANS) {
return (EINVAL);
}
if (flags & NFSMNT_TIMEO) {
return (EINVAL);
}
if (flags & NFSMNT_RSIZE) {
return (EINVAL);
}
if (flags & NFSMNT_WSIZE) {
return (EINVAL);
}
if (flags & NFSMNT_ACREGMIN) {
else
}
if (flags & NFSMNT_ACREGMAX) {
else
}
if (flags & NFSMNT_ACDIRMIN) {
else
}
if (flags & NFSMNT_ACDIRMAX) {
else
}
return (0);
}
/*
* This returns 1 if the seqid should be bumped upon receiving this
* 'res->status' for a seqid dependent operation; otherwise return 0.
*/
int
{
int i, seqid_dep_op = 0;
case OP_CLOSE:
case OP_OPEN:
case OP_OPEN_CONFIRM:
case OP_OPEN_DOWNGRADE:
case OP_LOCK:
case OP_LOCKU:
seqid_dep_op = 1;
break;
default:
continue;
}
}
if (!seqid_dep_op)
return (0);
case NFS4ERR_STALE_CLIENTID:
case NFS4ERR_STALE_STATEID:
case NFS4ERR_BAD_STATEID:
case NFS4ERR_BAD_SEQID:
case NFS4ERR_BADXDR:
case NFS4ERR_OLD_STATEID:
case NFS4ERR_RESOURCE:
case NFS4ERR_NOFILEHANDLE:
return (0);
default:
return (1);
}
}
/*
* Returns 1 if the error is a RPC error that we should retry.
*/
int
{
switch (error) {
case ETIMEDOUT:
case ECONNREFUSED:
case ENETDOWN:
case ENETUNREACH:
case ENETRESET:
case ECONNABORTED:
case EHOSTUNREACH:
case ECONNRESET:
return (1);
default:
return (0);
}
}
char *
{
switch (error) {
case NFS4_OK:
return ("NFS4_OK");
case NFS4ERR_PERM:
return ("NFS4ERR_PERM");
case NFS4ERR_NOENT:
return ("NFS4ERR_NOENT");
case NFS4ERR_IO:
return ("NFS4ERR_IO");
case NFS4ERR_NXIO:
return ("NFS4ERR_NXIO");
case NFS4ERR_ACCESS:
return ("NFS4ERR_ACCESS");
case NFS4ERR_EXIST:
return ("NFS4ERR_EXIST");
case NFS4ERR_XDEV:
return ("NFS4ERR_XDEV");
case NFS4ERR_NOTDIR:
return ("NFS4ERR_NOTDIR");
case NFS4ERR_ISDIR:
return ("NFS4ERR_ISDIR");
case NFS4ERR_INVAL:
return ("NFS4ERR_INVAL");
case NFS4ERR_FBIG:
return ("NFS4ERR_FBIG");
case NFS4ERR_NOSPC:
return ("NFS4ERR_NOSPC");
case NFS4ERR_ROFS:
return ("NFS4ERR_ROFS");
case NFS4ERR_MLINK:
return ("NFS4ERR_MLINK");
case NFS4ERR_NAMETOOLONG:
return ("NFS4ERR_NAMETOOLONG");
case NFS4ERR_NOTEMPTY:
return ("NFSS4ERR_NOTEMPTY");
case NFS4ERR_DQUOT:
return ("NFS4ERR_DQUOT");
case NFS4ERR_STALE:
return ("NFS4ERR_STALE");
case NFS4ERR_BADHANDLE:
return ("NFS4ERR_BADHANDLE");
case NFS4ERR_BAD_COOKIE:
return ("NFS4ERR_BAD_COOKIE");
case NFS4ERR_NOTSUPP:
return ("NFS4ERR_NOTSUPP");
case NFS4ERR_TOOSMALL:
return ("NFS4ERR_TOOSMALL");
case NFS4ERR_SERVERFAULT:
return ("NFS4ERR_SERVERFAULT");
case NFS4ERR_BADTYPE:
return ("NFS4ERR_BADTYPE");
case NFS4ERR_DELAY:
return ("NFS4ERR_DELAY");
case NFS4ERR_SAME:
return ("NFS4ERR_SAME");
case NFS4ERR_DENIED:
return ("NFS4ERR_DENIED");
case NFS4ERR_EXPIRED:
return ("NFS4ERR_EXPIRED");
case NFS4ERR_LOCKED:
return ("NFS4ERR_LOCKED");
case NFS4ERR_GRACE:
return ("NFS4ERR_GRACE");
case NFS4ERR_FHEXPIRED:
return ("NFS4ERR_FHEXPIRED");
case NFS4ERR_SHARE_DENIED:
return ("NFS4ERR_SHARE_DENIED");
case NFS4ERR_WRONGSEC:
return ("NFS4ERR_WRONGSEC");
case NFS4ERR_CLID_INUSE:
return ("NFS4ERR_CLID_INUSE");
case NFS4ERR_RESOURCE:
return ("NFS4ERR_RESOURCE");
case NFS4ERR_MOVED:
return ("NFS4ERR_MOVED");
case NFS4ERR_NOFILEHANDLE:
return ("NFS4ERR_NOFILEHANDLE");
return ("NFS4ERR_MINOR_VERS_MISMATCH");
case NFS4ERR_STALE_CLIENTID:
return ("NFS4ERR_STALE_CLIENTID");
case NFS4ERR_STALE_STATEID:
return ("NFS4ERR_STALE_STATEID");
case NFS4ERR_OLD_STATEID:
return ("NFS4ERR_OLD_STATEID");
case NFS4ERR_BAD_STATEID:
return ("NFS4ERR_BAD_STATEID");
case NFS4ERR_BAD_SEQID:
return ("NFS4ERR_BAD_SEQID");
case NFS4ERR_NOT_SAME:
return ("NFS4ERR_NOT_SAME");
case NFS4ERR_LOCK_RANGE:
return ("NFS4ERR_LOCK_RANGE");
case NFS4ERR_SYMLINK:
return ("NFS4ERR_SYMLINK");
case NFS4ERR_RESTOREFH:
return ("NFS4ERR_RESTOREFH");
case NFS4ERR_LEASE_MOVED:
return ("NFS4ERR_LEASE_MOVED");
case NFS4ERR_ATTRNOTSUPP:
return ("NFS4ERR_ATTRNOTSUPP");
case NFS4ERR_NO_GRACE:
return ("NFS4ERR_NO_GRACE");
case NFS4ERR_RECLAIM_BAD:
return ("NFS4ERR_RECLAIM_BAD");
case NFS4ERR_RECLAIM_CONFLICT:
return ("NFS4ERR_RECLAIM_CONFLICT");
case NFS4ERR_BADXDR:
return ("NFS4ERR_BADXDR");
case NFS4ERR_LOCKS_HELD:
return ("NFS4ERR_LOCKS_HELD");
case NFS4ERR_OPENMODE:
return ("NFS4ERR_OPENMODE");
case NFS4ERR_BADOWNER:
return ("NFS4ERR_BADOWNER");
case NFS4ERR_BADCHAR:
return ("NFS4ERR_BADCHAR");
case NFS4ERR_BADNAME:
return ("NFS4ERR_BADNAME");
case NFS4ERR_BAD_RANGE:
return ("NFS4ERR_BAD_RANGE");
case NFS4ERR_LOCK_NOTSUPP:
return ("NFS4ERR_LOCK_NOTSUPP");
case NFS4ERR_OP_ILLEGAL:
return ("NFS4ERR_OP_ILLEGAL");
case NFS4ERR_DEADLOCK:
return ("NFS4ERR_DEADLOCK");
case NFS4ERR_FILE_OPEN:
return ("NFS4ERR_FILE_OPEN");
case NFS4ERR_ADMIN_REVOKED:
return ("NFS4ERR_ADMIN_REVOKED");
case NFS4ERR_CB_PATH_DOWN:
return ("NFS4ERR_CB_PATH_DOWN");
default:
return (buf);
}
}
char *
{
switch (what) {
case NR_STALE:
return ("NR_STALE");
case NR_FAILOVER:
return ("NR_FAILOVER");
case NR_CLIENTID:
return ("NR_CLIENTID");
case NR_OPENFILES:
return ("NR_OPENFILES");
case NR_WRONGSEC:
return ("NR_WRONGSEC");
case NR_EXPIRED:
return ("NR_EXPIRED");
case NR_BAD_STATEID:
return ("NR_BAD_STATEID");
case NR_FHEXPIRED:
return ("NR_FHEXPIRED");
case NR_BADHANDLE:
return ("NR_BADHANDLE");
case NR_BAD_SEQID:
return ("NR_BAD_SEQID");
case NR_OLDSTATEID:
return ("NR_OLDSTATEID");
case NR_GRACE:
return ("NR_GRACE");
case NR_DELAY:
return ("NR_DELAY");
case NR_LOST_LOCK:
return ("NR_LOST_LOCK");
case NR_LOST_STATE_RQST:
return ("NR_LOST_STATE_RQST");
case NR_MOVED:
return ("NR_MOVED");
default:
return (buf);
}
}
char *
{
case OP_ACCESS:
return ("OP_ACCESS");
case OP_CLOSE:
return ("OP_CLOSE");
case OP_COMMIT:
return ("OP_COMMIT");
case OP_CREATE:
return ("OP_CREATE");
case OP_DELEGPURGE:
return ("OP_DELEGPURGE");
case OP_DELEGRETURN:
return ("OP_DELEGRETURN");
case OP_GETATTR:
return ("OP_GETATTR");
case OP_GETFH:
return ("OP_GETFH");
case OP_LINK:
return ("OP_LINK");
case OP_LOCK:
return ("OP_LOCK");
case OP_LOCKT:
return ("OP_LOCKT");
case OP_LOCKU:
return ("OP_LOCKU");
case OP_LOOKUP:
return ("OP_LOOKUP");
case OP_LOOKUPP:
return ("OP_LOOKUPP");
case OP_NVERIFY:
return ("OP_NVERIFY");
case OP_OPEN:
return ("OP_OPEN");
case OP_OPENATTR:
return ("OP_OPENATTR");
case OP_OPEN_CONFIRM:
return ("OP_OPEN_CONFIRM");
case OP_OPEN_DOWNGRADE:
return ("OP_OPEN_DOWNGRADE");
case OP_PUTFH:
return ("OP_PUTFH");
case OP_PUTPUBFH:
return ("OP_PUTPUBFH");
case OP_PUTROOTFH:
return ("OP_PUTROOTFH");
case OP_READ:
return ("OP_READ");
case OP_READDIR:
return ("OP_READDIR");
case OP_READLINK:
return ("OP_READLINK");
case OP_REMOVE:
return ("OP_REMOVE");
case OP_RENAME:
return ("OP_RENAME");
case OP_RENEW:
return ("OP_RENEW");
case OP_RESTOREFH:
return ("OP_RESTOREFH");
case OP_SAVEFH:
return ("OP_SAVEFH");
case OP_SECINFO:
return ("OP_SECINFO");
case OP_SETATTR:
return ("OP_SETATTR");
case OP_SETCLIENTID:
return ("OP_SETCLIENTID");
case OP_SETCLIENTID_CONFIRM:
return ("OP_SETCLIENTID_CONFIRM");
case OP_VERIFY:
return ("OP_VERIFY");
case OP_WRITE:
return ("OP_WRITE");
case OP_RELEASE_LOCKOWNER:
return ("OP_RELEASE_LOCKOWNER");
case OP_ILLEGAL:
return ("OP_ILLEGAL");
default:
return (buf);
}
}