1 /*
2    Copyright 2017 Skytechnology sp. z o.o..
3 
4    This file is part of LizardFS.
5 
6    LizardFS is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, version 3.
9 
10    LizardFS is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with LizardFS  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __LIZARDFS_ERROR_CODES_H
20 #define __LIZARDFS_ERROR_CODES_H
21 
22 #include <stdint.h>
23 
24 enum lizardfs_error_code {
25 	LIZARDFS_STATUS_OK                     =  0,    // OK
26 	LIZARDFS_ERROR_EPERM                   =  1,    // Operation not permitted
27 	LIZARDFS_ERROR_ENOTDIR                 =  2,    // Not a directory
28 	LIZARDFS_ERROR_ENOENT                  =  3,    // No such file or directory
29 	LIZARDFS_ERROR_EACCES                  =  4,    // Permission denied
30 	LIZARDFS_ERROR_EEXIST                  =  5,    // File exists
31 	LIZARDFS_ERROR_EINVAL                  =  6,    // Invalid argument
32 	LIZARDFS_ERROR_ENOTEMPTY               =  7,    // Directory not empty
33 	LIZARDFS_ERROR_CHUNKLOST               =  8,    // Chunk lost
34 	LIZARDFS_ERROR_OUTOFMEMORY             =  9,    // Out of memory
35 	LIZARDFS_ERROR_INDEXTOOBIG             = 10,    // Index too big
36 	LIZARDFS_ERROR_LOCKED                  = 11,    // Chunk locked
37 	LIZARDFS_ERROR_NOCHUNKSERVERS          = 12,    // No chunk servers
38 	LIZARDFS_ERROR_NOCHUNK                 = 13,    // No such chunk
39 	LIZARDFS_ERROR_CHUNKBUSY               = 14,    // Chunk is busy
40 	LIZARDFS_ERROR_REGISTER                = 15,    // Incorrect register BLOB
41 	LIZARDFS_ERROR_NOTDONE                 = 16,    // Requested operation not completed
42 	LIZARDFS_ERROR_GROUPNOTREGISTERED      = 17,    // Group info is not registered in master server
43 	LIZARDFS_ERROR_NOTSTARTED              = 18,    // Write not started
44 	LIZARDFS_ERROR_WRONGVERSION            = 19,    // Wrong chunk version
45 	LIZARDFS_ERROR_CHUNKEXIST              = 20,    // Chunk already exists
46 	LIZARDFS_ERROR_NOSPACE                 = 21,    // No space left
47 	LIZARDFS_ERROR_IO                      = 22,    // IO error
48 	LIZARDFS_ERROR_BNUMTOOBIG              = 23,    // Incorrect block number
49 	LIZARDFS_ERROR_WRONGSIZE               = 24,    // Incorrect size
50 	LIZARDFS_ERROR_WRONGOFFSET             = 25,    // Incorrect offset
51 	LIZARDFS_ERROR_CANTCONNECT             = 26,    // Can't connect
52 	LIZARDFS_ERROR_WRONGCHUNKID            = 27,    // Incorrect chunk id
53 	LIZARDFS_ERROR_DISCONNECTED            = 28,    // Disconnected
54 	LIZARDFS_ERROR_CRC                     = 29,    // CRC error
55 	LIZARDFS_ERROR_DELAYED                 = 30,    // Operation delayed
56 	LIZARDFS_ERROR_CANTCREATEPATH          = 31,    // Can't create path
57 	LIZARDFS_ERROR_MISMATCH                = 32,    // Data mismatch
58 	LIZARDFS_ERROR_EROFS                   = 33,    // Read-only file system
59 	LIZARDFS_ERROR_QUOTA                   = 34,    // Quota exceeded
60 	LIZARDFS_ERROR_BADSESSIONID            = 35,    // Bad session id
61 	LIZARDFS_ERROR_NOPASSWORD              = 36,    // Password is needed
62 	LIZARDFS_ERROR_BADPASSWORD             = 37,    // Incorrect password
63 	LIZARDFS_ERROR_ENOATTR                 = 38,    // Attribute not found
64 	LIZARDFS_ERROR_ENOTSUP                 = 39,    // Operation not supported
65 	LIZARDFS_ERROR_ERANGE                  = 40,    // Result too large
66 	LIZARDFS_ERROR_TIMEOUT                 = 41,    // Timeout
67 	LIZARDFS_ERROR_BADMETADATACHECKSUM     = 42,    // Metadata checksum not matching
68 	LIZARDFS_ERROR_CHANGELOGINCONSISTENT   = 43,    // Changelog inconsistent
69 	LIZARDFS_ERROR_PARSE                   = 44,    // Parsing unsuccessful
70 	LIZARDFS_ERROR_METADATAVERSIONMISMATCH = 45,    // Metadata version mismatch
71 	LIZARDFS_ERROR_NOTLOCKED               = 46,    // No such lock
72 	LIZARDFS_ERROR_WRONGLOCKID             = 47,    // Wrong lock id
73 	LIZARDFS_ERROR_NOTPOSSIBLE             = 48,    // It's not possible to perform operation in this way
74 	LIZARDFS_ERROR_TEMP_NOTPOSSIBLE        = 49,    // Operation temporarily not possible
75 	LIZARDFS_ERROR_WAITING                 = 50,    // Waiting for operation completion
76 	LIZARDFS_ERROR_UNKNOWN                 = 51,    // Unknown error
77 	LIZARDFS_ERROR_ENAMETOOLONG            = 52,    // Name too long
78 	LIZARDFS_ERROR_EFBIG                   = 53,    // File too large
79 	LIZARDFS_ERROR_EBADF                   = 54,    // Bad file number
80 	LIZARDFS_ERROR_ENODATA                 = 55,    // No data available
81 	LIZARDFS_ERROR_E2BIG                   = 56,    // Argument list too long
82 	LIZARDFS_ERROR_MAX                     = 57
83 };
84 
85 const char *lizardfs_error_string(uint8_t status);
86 
87 #endif
88