+ * 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.
+ */
+char nfs_pageouterrorhandler(int);
+enum actiontype {NOACTION, DUMP, DUMPANDLOG, RETRY, RETRYWITHSLEEP, SEVER};
+#define NFS_ELAST 88
+static u_char errorcount[NFS_ELAST+1]; /* better be zeros when initialized */
+static const char errortooutcome[NFS_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 */
+};
+
+char
+nfs_pageouterrorhandler(int error)
+{
+ if (error > NFS_ELAST)
+ return(DUMP);
+ else
+ return(errortooutcome[error]);
+}
+
+
+/*
+ * vnode OP for pageout using UPL
+ *
+ * No buffer I/O, just RPCs straight from the mapped pages.