1/* 2 * GPL HEADER START 3 * 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 only, 8 * as published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but 11 * WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * General Public License version 2 for more details (a copy is included 14 * in the LICENSE file that accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License 17 * version 2 along with this program; If not, see 18 * http://www.gnu.org/licenses/gpl-2.0.txt 19 * 20 * GPL HEADER END 21 */ 22/* 23 * Copyright (C) 2011 FUJITSU LIMITED. All rights reserved. 24 * 25 * Copyright (c) 2013, Intel Corporation. 26 */ 27 28#ifndef LUSTRE_ERRNO_H 29#define LUSTRE_ERRNO_H 30 31/* 32 * Only "network" errnos, which are defined below, are allowed on wire (or on 33 * disk). Generic routines exist to help translate between these and a subset 34 * of the "host" errnos. Some host errnos (e.g., EDEADLOCK) are intentionally 35 * left out. See also the comment on lustre_errno_hton_mapping[]. 36 * 37 * To maintain compatibility with existing x86 clients and servers, each of 38 * these network errnos has the same numerical value as its corresponding host 39 * errno on x86. 40 */ 41#define LUSTRE_EPERM 1 /* Operation not permitted */ 42#define LUSTRE_ENOENT 2 /* No such file or directory */ 43#define LUSTRE_ESRCH 3 /* No such process */ 44#define LUSTRE_EINTR 4 /* Interrupted system call */ 45#define LUSTRE_EIO 5 /* I/O error */ 46#define LUSTRE_ENXIO 6 /* No such device or address */ 47#define LUSTRE_E2BIG 7 /* Argument list too long */ 48#define LUSTRE_ENOEXEC 8 /* Exec format error */ 49#define LUSTRE_EBADF 9 /* Bad file number */ 50#define LUSTRE_ECHILD 10 /* No child processes */ 51#define LUSTRE_EAGAIN 11 /* Try again */ 52#define LUSTRE_ENOMEM 12 /* Out of memory */ 53#define LUSTRE_EACCES 13 /* Permission denied */ 54#define LUSTRE_EFAULT 14 /* Bad address */ 55#define LUSTRE_ENOTBLK 15 /* Block device required */ 56#define LUSTRE_EBUSY 16 /* Device or resource busy */ 57#define LUSTRE_EEXIST 17 /* File exists */ 58#define LUSTRE_EXDEV 18 /* Cross-device link */ 59#define LUSTRE_ENODEV 19 /* No such device */ 60#define LUSTRE_ENOTDIR 20 /* Not a directory */ 61#define LUSTRE_EISDIR 21 /* Is a directory */ 62#define LUSTRE_EINVAL 22 /* Invalid argument */ 63#define LUSTRE_ENFILE 23 /* File table overflow */ 64#define LUSTRE_EMFILE 24 /* Too many open files */ 65#define LUSTRE_ENOTTY 25 /* Not a typewriter */ 66#define LUSTRE_ETXTBSY 26 /* Text file busy */ 67#define LUSTRE_EFBIG 27 /* File too large */ 68#define LUSTRE_ENOSPC 28 /* No space left on device */ 69#define LUSTRE_ESPIPE 29 /* Illegal seek */ 70#define LUSTRE_EROFS 30 /* Read-only file system */ 71#define LUSTRE_EMLINK 31 /* Too many links */ 72#define LUSTRE_EPIPE 32 /* Broken pipe */ 73#define LUSTRE_EDOM 33 /* Math argument out of func domain */ 74#define LUSTRE_ERANGE 34 /* Math result not representable */ 75#define LUSTRE_EDEADLK 35 /* Resource deadlock would occur */ 76#define LUSTRE_ENAMETOOLONG 36 /* File name too long */ 77#define LUSTRE_ENOLCK 37 /* No record locks available */ 78#define LUSTRE_ENOSYS 38 /* Function not implemented */ 79#define LUSTRE_ENOTEMPTY 39 /* Directory not empty */ 80#define LUSTRE_ELOOP 40 /* Too many symbolic links found */ 81#define LUSTRE_ENOMSG 42 /* No message of desired type */ 82#define LUSTRE_EIDRM 43 /* Identifier removed */ 83#define LUSTRE_ECHRNG 44 /* Channel number out of range */ 84#define LUSTRE_EL2NSYNC 45 /* Level 2 not synchronized */ 85#define LUSTRE_EL3HLT 46 /* Level 3 halted */ 86#define LUSTRE_EL3RST 47 /* Level 3 reset */ 87#define LUSTRE_ELNRNG 48 /* Link number out of range */ 88#define LUSTRE_EUNATCH 49 /* Protocol driver not attached */ 89#define LUSTRE_ENOCSI 50 /* No CSI structure available */ 90#define LUSTRE_EL2HLT 51 /* Level 2 halted */ 91#define LUSTRE_EBADE 52 /* Invalid exchange */ 92#define LUSTRE_EBADR 53 /* Invalid request descriptor */ 93#define LUSTRE_EXFULL 54 /* Exchange full */ 94#define LUSTRE_ENOANO 55 /* No anode */ 95#define LUSTRE_EBADRQC 56 /* Invalid request code */ 96#define LUSTRE_EBADSLT 57 /* Invalid slot */ 97#define LUSTRE_EBFONT 59 /* Bad font file format */ 98#define LUSTRE_ENOSTR 60 /* Device not a stream */ 99#define LUSTRE_ENODATA 61 /* No data available */ 100#define LUSTRE_ETIME 62 /* Timer expired */ 101#define LUSTRE_ENOSR 63 /* Out of streams resources */ 102#define LUSTRE_ENONET 64 /* Machine is not on the network */ 103#define LUSTRE_ENOPKG 65 /* Package not installed */ 104#define LUSTRE_EREMOTE 66 /* Object is remote */ 105#define LUSTRE_ENOLINK 67 /* Link has been severed */ 106#define LUSTRE_EADV 68 /* Advertise error */ 107#define LUSTRE_ESRMNT 69 /* Srmount error */ 108#define LUSTRE_ECOMM 70 /* Communication error on send */ 109#define LUSTRE_EPROTO 71 /* Protocol error */ 110#define LUSTRE_EMULTIHOP 72 /* Multihop attempted */ 111#define LUSTRE_EDOTDOT 73 /* RFS specific error */ 112#define LUSTRE_EBADMSG 74 /* Not a data message */ 113#define LUSTRE_EOVERFLOW 75 /* Value too large for data type */ 114#define LUSTRE_ENOTUNIQ 76 /* Name not unique on network */ 115#define LUSTRE_EBADFD 77 /* File descriptor in bad state */ 116#define LUSTRE_EREMCHG 78 /* Remote address changed */ 117#define LUSTRE_ELIBACC 79 /* Can't access needed shared library */ 118#define LUSTRE_ELIBBAD 80 /* Access corrupted shared library */ 119#define LUSTRE_ELIBSCN 81 /* .lib section in a.out corrupted */ 120#define LUSTRE_ELIBMAX 82 /* Trying to link too many libraries */ 121#define LUSTRE_ELIBEXEC 83 /* Cannot exec a shared lib directly */ 122#define LUSTRE_EILSEQ 84 /* Illegal byte sequence */ 123#define LUSTRE_ERESTART 85 /* Restart interrupted system call */ 124#define LUSTRE_ESTRPIPE 86 /* Streams pipe error */ 125#define LUSTRE_EUSERS 87 /* Too many users */ 126#define LUSTRE_ENOTSOCK 88 /* Socket operation on non-socket */ 127#define LUSTRE_EDESTADDRREQ 89 /* Destination address required */ 128#define LUSTRE_EMSGSIZE 90 /* Message too long */ 129#define LUSTRE_EPROTOTYPE 91 /* Protocol wrong type for socket */ 130#define LUSTRE_ENOPROTOOPT 92 /* Protocol not available */ 131#define LUSTRE_EPROTONOSUPPORT 93 /* Protocol not supported */ 132#define LUSTRE_ESOCKTNOSUPPORT 94 /* Socket type not supported */ 133#define LUSTRE_EOPNOTSUPP 95 /* Operation not supported */ 134#define LUSTRE_EPFNOSUPPORT 96 /* Protocol family not supported */ 135#define LUSTRE_EAFNOSUPPORT 97 /* Address family not supported */ 136#define LUSTRE_EADDRINUSE 98 /* Address already in use */ 137#define LUSTRE_EADDRNOTAVAIL 99 /* Cannot assign requested address */ 138#define LUSTRE_ENETDOWN 100 /* Network is down */ 139#define LUSTRE_ENETUNREACH 101 /* Network is unreachable */ 140#define LUSTRE_ENETRESET 102 /* Network connection drop for reset */ 141#define LUSTRE_ECONNABORTED 103 /* Software caused connection abort */ 142#define LUSTRE_ECONNRESET 104 /* Connection reset by peer */ 143#define LUSTRE_ENOBUFS 105 /* No buffer space available */ 144#define LUSTRE_EISCONN 106 /* Transport endpoint is connected */ 145#define LUSTRE_ENOTCONN 107 /* Transport endpoint not connected */ 146#define LUSTRE_ESHUTDOWN 108 /* Cannot send after shutdown */ 147#define LUSTRE_ETOOMANYREFS 109 /* Too many references: cannot splice */ 148#define LUSTRE_ETIMEDOUT 110 /* Connection timed out */ 149#define LUSTRE_ECONNREFUSED 111 /* Connection refused */ 150#define LUSTRE_EHOSTDOWN 112 /* Host is down */ 151#define LUSTRE_EHOSTUNREACH 113 /* No route to host */ 152#define LUSTRE_EALREADY 114 /* Operation already in progress */ 153#define LUSTRE_EINPROGRESS 115 /* Operation now in progress */ 154#define LUSTRE_ESTALE 116 /* Stale file handle */ 155#define LUSTRE_EUCLEAN 117 /* Structure needs cleaning */ 156#define LUSTRE_ENOTNAM 118 /* Not a XENIX named type file */ 157#define LUSTRE_ENAVAIL 119 /* No XENIX semaphores available */ 158#define LUSTRE_EISNAM 120 /* Is a named type file */ 159#define LUSTRE_EREMOTEIO 121 /* Remote I/O error */ 160#define LUSTRE_EDQUOT 122 /* Quota exceeded */ 161#define LUSTRE_ENOMEDIUM 123 /* No medium found */ 162#define LUSTRE_EMEDIUMTYPE 124 /* Wrong medium type */ 163#define LUSTRE_ECANCELED 125 /* Operation Canceled */ 164#define LUSTRE_ENOKEY 126 /* Required key not available */ 165#define LUSTRE_EKEYEXPIRED 127 /* Key has expired */ 166#define LUSTRE_EKEYREVOKED 128 /* Key has been revoked */ 167#define LUSTRE_EKEYREJECTED 129 /* Key was rejected by service */ 168#define LUSTRE_EOWNERDEAD 130 /* Owner died */ 169#define LUSTRE_ENOTRECOVERABLE 131 /* State not recoverable */ 170#define LUSTRE_ERESTARTSYS 512 171#define LUSTRE_ERESTARTNOINTR 513 172#define LUSTRE_ERESTARTNOHAND 514 /* restart if no handler.. */ 173#define LUSTRE_ENOIOCTLCMD 515 /* No ioctl command */ 174#define LUSTRE_ERESTART_RESTARTBLOCK 516 /* restart via sys_restart_syscall */ 175#define LUSTRE_EBADHANDLE 521 /* Illegal NFS file handle */ 176#define LUSTRE_ENOTSYNC 522 /* Update synchronization mismatch */ 177#define LUSTRE_EBADCOOKIE 523 /* Cookie is stale */ 178#define LUSTRE_ENOTSUPP 524 /* Operation is not supported */ 179#define LUSTRE_ETOOSMALL 525 /* Buffer or request is too small */ 180#define LUSTRE_ESERVERFAULT 526 /* An untranslatable error occurred */ 181#define LUSTRE_EBADTYPE 527 /* Type not supported by server */ 182#define LUSTRE_EJUKEBOX 528 /* Request won't finish until timeout */ 183#define LUSTRE_EIOCBQUEUED 529 /* iocb queued await completion event */ 184#define LUSTRE_EIOCBRETRY 530 /* iocb queued, will trigger a retry */ 185 186/* 187 * Translations are optimized away on x86. Host errnos that shouldn't be put 188 * on wire could leak through as a result. Do not count on this side effect. 189 */ 190#ifdef CONFIG_LUSTRE_TRANSLATE_ERRNOS 191unsigned int lustre_errno_hton(unsigned int h); 192unsigned int lustre_errno_ntoh(unsigned int n); 193#else 194#define lustre_errno_hton(h) (h) 195#define lustre_errno_ntoh(n) (n) 196#endif 197 198#endif /* LUSTRE_ERRNO_H */ 199