From 9a6930e9bedb930ac44e540ef7f5633b61d270c2 Mon Sep 17 00:00:00 2001 From: Yan Zheng Date: Wed, 7 Jan 2009 14:57:12 -0500 Subject: Add semantic checks to btrfsck for files and directories This patch makes btrfsck check more things, including directory items, file extents, checksumming, inode link counts etc. The code for these checks is similar to the code verifies extent back references. The main difference is that shared tree blocks are treated specially. The partial checking results(unresolved references and/or errors) of shared sub-trees are cached. This avoids scanning the shared blocks several times. Thank you, Signed-off-by: Yan Zheng --- extent-cache.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'extent-cache.h') diff --git a/extent-cache.h b/extent-cache.h index 4c468cea..7f2f2a66 100644 --- a/extent-cache.h +++ b/extent-cache.h @@ -44,6 +44,11 @@ int insert_cache_extent(struct cache_tree *tree, u64 start, u64 size); int insert_existing_cache_extent(struct cache_tree *tree, struct cache_extent *pe); +static inline int cache_tree_empty(struct cache_tree *tree) +{ + return RB_EMPTY_ROOT(&tree->root); +} + static inline void free_cache_extent(struct cache_extent *pe) { free(pe); -- cgit v1.2.1