blob: 32fecc9dc1dd26b7e561d2cb3ee82d8ea99ccd4e [file] [log] [blame]
David Sterba9888c342018-04-03 19:16:55 +02001/* SPDX-License-Identifier: GPL-2.0 */
Qu Wenruo557ea5d2017-10-09 01:51:02 +00002/*
3 * Copyright (C) Qu Wenruo 2017. All rights reserved.
Qu Wenruo557ea5d2017-10-09 01:51:02 +00004 */
5
David Sterba9888c342018-04-03 19:16:55 +02006#ifndef BTRFS_TREE_CHECKER_H
7#define BTRFS_TREE_CHECKER_H
Qu Wenruo557ea5d2017-10-09 01:51:02 +00008
9#include "ctree.h"
10#include "extent_io.h"
11
Qu Wenruo69fc6cb2017-11-08 08:54:24 +080012/*
13 * Comprehensive leaf checker.
14 * Will check not only the item pointers, but also every possible member
15 * in item data.
16 */
David Sterba1c4360e2019-03-20 16:23:29 +010017int btrfs_check_leaf_full(struct extent_buffer *leaf);
Qu Wenruo69fc6cb2017-11-08 08:54:24 +080018
19/*
20 * Less strict leaf checker.
21 * Will only check item pointers, not reading item data.
22 */
David Sterbacfdaad52019-03-20 16:24:18 +010023int btrfs_check_leaf_relaxed(struct extent_buffer *leaf);
David Sterba813fd1d2019-03-20 16:25:00 +010024int btrfs_check_node(struct extent_buffer *node);
Qu Wenruo557ea5d2017-10-09 01:51:02 +000025
David Sterbaddaf1d52019-03-20 16:40:48 +010026int btrfs_check_chunk_valid(struct extent_buffer *leaf,
Qu Wenruo82fc28f2019-03-20 13:16:42 +080027 struct btrfs_chunk *chunk, u64 logical);
28
Qu Wenruo557ea5d2017-10-09 01:51:02 +000029#endif