btrfs-progs: check: Move definitions of lowmem mode to check/lowmem.h
[platform/upstream/btrfs-progs.git] / check / lowmem.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public
4  * License v2 as published by the Free Software Foundation.
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9  * General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the
13  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
14  * Boston, MA 021110-1307, USA.
15  */
16
17 /*
18  * Defines and function declarations for lowmem mode check.
19  */
20 #ifndef __BTRFS_CHECK_LOWMEM_H__
21 #define __BTRFS_CHECK_LOWMEM_H__
22
23 #define ROOT_DIR_ERROR          (1<<1)  /* bad ROOT_DIR */
24 #define DIR_ITEM_MISSING        (1<<2)  /* DIR_ITEM not found */
25 #define DIR_ITEM_MISMATCH       (1<<3)  /* DIR_ITEM found but not match */
26 #define INODE_REF_MISSING       (1<<4)  /* INODE_REF/INODE_EXTREF not found */
27 #define INODE_ITEM_MISSING      (1<<5)  /* INODE_ITEM not found */
28 #define INODE_ITEM_MISMATCH     (1<<6)  /* INODE_ITEM found but not match */
29 #define FILE_EXTENT_ERROR       (1<<7)  /* bad FILE_EXTENT */
30 #define ODD_CSUM_ITEM           (1<<8)  /* CSUM_ITEM error */
31 #define CSUM_ITEM_MISSING       (1<<9)  /* CSUM_ITEM not found */
32 #define LINK_COUNT_ERROR        (1<<10) /* INODE_ITEM nlink count error */
33 #define NBYTES_ERROR            (1<<11) /* INODE_ITEM nbytes count error */
34 #define ISIZE_ERROR             (1<<12) /* INODE_ITEM size count error */
35 #define ORPHAN_ITEM             (1<<13) /* INODE_ITEM no reference */
36 #define NO_INODE_ITEM           (1<<14) /* no inode_item */
37 #define LAST_ITEM               (1<<15) /* Complete this tree traversal */
38 #define ROOT_REF_MISSING        (1<<16) /* ROOT_REF not found */
39 #define ROOT_REF_MISMATCH       (1<<17) /* ROOT_REF found but not match */
40 #define DIR_INDEX_MISSING       (1<<18) /* INODE_INDEX not found */
41 #define DIR_INDEX_MISMATCH      (1<<19) /* INODE_INDEX found but not match */
42 #define DIR_COUNT_AGAIN         (1<<20) /* DIR isize should be recalculated */
43 #define BG_ACCOUNTING_ERROR     (1<<21) /* Block group accounting error */
44
45 /*
46  * Error bit for low memory mode check.
47  *
48  * Currently no caller cares about it yet.  Just internal use for error
49  * classification.
50  */
51 #define BACKREF_MISSING         (1 << 0) /* Backref missing in extent tree */
52 #define BACKREF_MISMATCH        (1 << 1) /* Backref exists but does not match */
53 #define BYTES_UNALIGNED         (1 << 2) /* Some bytes are not aligned */
54 #define REFERENCER_MISSING      (1 << 3) /* Referencer not found */
55 #define REFERENCER_MISMATCH     (1 << 4) /* Referenceer found but does not match */
56 #define CROSSING_STRIPE_BOUNDARY (1 << 4) /* For kernel scrub workaround */
57 #define ITEM_SIZE_MISMATCH      (1 << 5) /* Bad item size */
58 #define UNKNOWN_TYPE            (1 << 6) /* Unknown type */
59 #define ACCOUNTING_MISMATCH     (1 << 7) /* Used space accounting error */
60 #define CHUNK_TYPE_MISMATCH     (1 << 8)
61
62 #endif