-extern u_long nfs_xdrneg1;
-extern u_long nfs_true, nfs_false;
-extern struct nfsstats nfsstats;
-extern nfstype nfsv3_type[9];
-proc_t nfs_iodwant[NFS_MAXASYNCDAEMON];
-struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON];
-
-lck_grp_t *nfs_iod_lck_grp;
-lck_grp_attr_t *nfs_iod_lck_grp_attr;
-lck_attr_t *nfs_iod_lck_attr;
-lck_mtx_t *nfs_iod_mutex;
-
-int nfs_numasync = 0;
-int nfs_ioddelwri = 0;
-
-#define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1))
-
-static int nfsaccess_cache_timeout = NFS_MAXATTRTIMO;
-/* SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
- &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
-*/
-#define NFSV3ACCESS_ALL (NFSV3ACCESS_READ | NFSV3ACCESS_MODIFY \
- | NFSV3ACCESS_EXTEND | NFSV3ACCESS_EXECUTE \
- | NFSV3ACCESS_DELETE | NFSV3ACCESS_LOOKUP)
-
-
-/*
- * the following are needed only by nfs_pageout to know how to handle errors
- * see nfs_pageout comments on explanation of actions.
- * the errors here are copied from errno.h and errors returned by servers
- * are expected to match the same numbers here. If not, our actions maybe
- * erroneous.
- */
-enum actiontype {NOACTION, DUMP, DUMPANDLOG, RETRY, RETRYWITHSLEEP, SEVER};
-
-static int errorcount[ELAST+1]; /* better be zeros when initialized */
-
-static const short errortooutcome[ELAST+1] = {
- NOACTION,
- DUMP, /* EPERM 1 Operation not permitted */
- DUMP, /* ENOENT 2 No such file or directory */
- DUMPANDLOG, /* ESRCH 3 No such process */
- RETRY, /* EINTR 4 Interrupted system call */
- DUMP, /* EIO 5 Input/output error */
- DUMP, /* ENXIO 6 Device not configured */
- DUMPANDLOG, /* E2BIG 7 Argument list too long */
- DUMPANDLOG, /* ENOEXEC 8 Exec format error */
- DUMPANDLOG, /* EBADF 9 Bad file descriptor */
- DUMPANDLOG, /* ECHILD 10 No child processes */
- DUMPANDLOG, /* EDEADLK 11 Resource deadlock avoided - was EAGAIN */
- RETRY, /* ENOMEM 12 Cannot allocate memory */
- DUMP, /* EACCES 13 Permission denied */
- DUMPANDLOG, /* EFAULT 14 Bad address */
- DUMPANDLOG, /* ENOTBLK 15 POSIX - Block device required */
- RETRY, /* EBUSY 16 Device busy */
- DUMP, /* EEXIST 17 File exists */
- DUMP, /* EXDEV 18 Cross-device link */
- DUMP, /* ENODEV 19 Operation not supported by device */
- DUMP, /* ENOTDIR 20 Not a directory */
- DUMP, /* EISDIR 21 Is a directory */
- DUMP, /* EINVAL 22 Invalid argument */
- DUMPANDLOG, /* ENFILE 23 Too many open files in system */
- DUMPANDLOG, /* EMFILE 24 Too many open files */
- DUMPANDLOG, /* ENOTTY 25 Inappropriate ioctl for device */
- DUMPANDLOG, /* ETXTBSY 26 Text file busy - POSIX */
- DUMP, /* EFBIG 27 File too large */
- DUMP, /* ENOSPC 28 No space left on device */
- DUMPANDLOG, /* ESPIPE 29 Illegal seek */
- DUMP, /* EROFS 30 Read-only file system */
- DUMP, /* EMLINK 31 Too many links */
- RETRY, /* EPIPE 32 Broken pipe */
- /* math software */
- DUMPANDLOG, /* EDOM 33 Numerical argument out of domain */
- DUMPANDLOG, /* ERANGE 34 Result too large */
- RETRY, /* EAGAIN/EWOULDBLOCK 35 Resource temporarily unavailable */
- DUMPANDLOG, /* EINPROGRESS 36 Operation now in progress */
- DUMPANDLOG, /* EALREADY 37 Operation already in progress */
- /* ipc/network software -- argument errors */
- DUMPANDLOG, /* ENOTSOC 38 Socket operation on non-socket */
- DUMPANDLOG, /* EDESTADDRREQ 39 Destination address required */
- DUMPANDLOG, /* EMSGSIZE 40 Message too long */
- DUMPANDLOG, /* EPROTOTYPE 41 Protocol wrong type for socket */
- DUMPANDLOG, /* ENOPROTOOPT 42 Protocol not available */
- DUMPANDLOG, /* EPROTONOSUPPORT 43 Protocol not supported */
- DUMPANDLOG, /* ESOCKTNOSUPPORT 44 Socket type not supported */
- DUMPANDLOG, /* ENOTSUP 45 Operation not supported */
- DUMPANDLOG, /* EPFNOSUPPORT 46 Protocol family not supported */
- DUMPANDLOG, /* EAFNOSUPPORT 47 Address family not supported by protocol family */
- DUMPANDLOG, /* EADDRINUSE 48 Address already in use */
- DUMPANDLOG, /* EADDRNOTAVAIL 49 Can't assign requested address */
- /* ipc/network software -- operational errors */
- RETRY, /* ENETDOWN 50 Network is down */
- RETRY, /* ENETUNREACH 51 Network is unreachable */
- RETRY, /* ENETRESET 52 Network dropped connection on reset */
- RETRY, /* ECONNABORTED 53 Software caused connection abort */
- RETRY, /* ECONNRESET 54 Connection reset by peer */
- RETRY, /* ENOBUFS 55 No buffer space available */
- RETRY, /* EISCONN 56 Socket is already connected */
- RETRY, /* ENOTCONN 57 Socket is not connected */
- RETRY, /* ESHUTDOWN 58 Can't send after socket shutdown */
- RETRY, /* ETOOMANYREFS 59 Too many references: can't splice */
- RETRY, /* ETIMEDOUT 60 Operation timed out */
- RETRY, /* ECONNREFUSED 61 Connection refused */
-
- DUMPANDLOG, /* ELOOP 62 Too many levels of symbolic links */
- DUMP, /* ENAMETOOLONG 63 File name too long */
- RETRY, /* EHOSTDOWN 64 Host is down */
- RETRY, /* EHOSTUNREACH 65 No route to host */
- DUMP, /* ENOTEMPTY 66 Directory not empty */
- /* quotas & mush */
- DUMPANDLOG, /* PROCLIM 67 Too many processes */
- DUMPANDLOG, /* EUSERS 68 Too many users */
- DUMPANDLOG, /* EDQUOT 69 Disc quota exceeded */
- /* Network File System */
- DUMP, /* ESTALE 70 Stale NFS file handle */
- DUMP, /* EREMOTE 71 Too many levels of remote in path */
- DUMPANDLOG, /* EBADRPC 72 RPC struct is bad */
- DUMPANDLOG, /* ERPCMISMATCH 73 RPC version wrong */
- DUMPANDLOG, /* EPROGUNAVAIL 74 RPC prog. not avail */
- DUMPANDLOG, /* EPROGMISMATCH 75 Program version wrong */
- DUMPANDLOG, /* EPROCUNAVAIL 76 Bad procedure for program */
-
- DUMPANDLOG, /* ENOLCK 77 No locks available */
- DUMPANDLOG, /* ENOSYS 78 Function not implemented */
- DUMPANDLOG, /* EFTYPE 79 Inappropriate file type or format */
- DUMPANDLOG, /* EAUTH 80 Authentication error */
- DUMPANDLOG, /* ENEEDAUTH 81 Need authenticator */
- /* Intelligent device errors */
- DUMPANDLOG, /* EPWROFF 82 Device power is off */
- DUMPANDLOG, /* EDEVERR 83 Device error, e.g. paper out */
- DUMPANDLOG, /* EOVERFLOW 84 Value too large to be stored in data type */
- /* Program loading errors */
- DUMPANDLOG, /* EBADEXEC 85 Bad executable */
- DUMPANDLOG, /* EBADARCH 86 Bad CPU type in executable */
- DUMPANDLOG, /* ESHLIBVERS 87 Shared library version mismatch */
- DUMPANDLOG, /* EBADMACHO 88 Malformed Macho file */
-};
-
-
-static short
-nfs_pageouterrorhandler(int error)