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.
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.
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.
18 * Defines and function declarations for lowmem mode check.
20 #ifndef __BTRFS_CHECK_MODE_LOWMEM_H__
21 #define __BTRFS_CHECK_MODE_LOWMEM_H__
23 #include "check/mode-common.h"
25 #define ROOT_DIR_ERROR (1<<1) /* bad ROOT_DIR */
26 #define DIR_ITEM_MISSING (1<<2) /* DIR_ITEM not found */
27 #define DIR_ITEM_MISMATCH (1<<3) /* DIR_ITEM found but not match */
28 #define INODE_REF_MISSING (1<<4) /* INODE_REF/INODE_EXTREF not found */
29 #define INODE_ITEM_MISSING (1<<5) /* INODE_ITEM not found */
30 #define INODE_ITEM_MISMATCH (1<<6) /* INODE_ITEM found but not match */
31 #define FILE_EXTENT_ERROR (1<<7) /* bad FILE_EXTENT */
32 #define ODD_CSUM_ITEM (1<<8) /* CSUM_ITEM error */
33 #define CSUM_ITEM_MISSING (1<<9) /* CSUM_ITEM not found */
34 #define LINK_COUNT_ERROR (1<<10) /* INODE_ITEM nlink count error */
35 #define NBYTES_ERROR (1<<11) /* INODE_ITEM nbytes count error */
36 #define ISIZE_ERROR (1<<12) /* INODE_ITEM size count error */
37 #define ORPHAN_ITEM (1<<13) /* INODE_ITEM no reference */
38 #define NO_INODE_ITEM (1<<14) /* no inode_item */
39 #define LAST_ITEM (1<<15) /* Complete this tree traversal */
40 #define ROOT_REF_MISSING (1<<16) /* ROOT_REF not found */
41 #define ROOT_REF_MISMATCH (1<<17) /* ROOT_REF found but not match */
42 #define DIR_INDEX_MISSING (1<<18) /* INODE_INDEX not found */
43 #define DIR_INDEX_MISMATCH (1<<19) /* INODE_INDEX found but not match */
44 #define DIR_COUNT_AGAIN (1<<20) /* DIR isize should be recalculated */
45 #define BG_ACCOUNTING_ERROR (1<<21) /* Block group accounting error */
48 * Error bit for low memory mode check.
50 * Currently no caller cares about it yet. Just internal use for error
53 #define BACKREF_MISSING (1 << 0) /* Backref missing in extent tree */
54 #define BACKREF_MISMATCH (1 << 1) /* Backref exists but does not match */
55 #define BYTES_UNALIGNED (1 << 2) /* Some bytes are not aligned */
56 #define REFERENCER_MISSING (1 << 3) /* Referencer not found */
57 #define REFERENCER_MISMATCH (1 << 4) /* Referenceer found but does not match */
58 #define CROSSING_STRIPE_BOUNDARY (1 << 4) /* For kernel scrub workaround */
59 #define ITEM_SIZE_MISMATCH (1 << 5) /* Bad item size */
60 #define UNKNOWN_TYPE (1 << 6) /* Unknown type */
61 #define ACCOUNTING_MISMATCH (1 << 7) /* Used space accounting error */
62 #define CHUNK_TYPE_MISMATCH (1 << 8)
64 int check_fs_roots_lowmem(struct btrfs_fs_info *fs_info);
65 int check_chunks_and_extents_lowmem(struct btrfs_fs_info *fs_info);