summaryrefslogtreecommitdiff
path: root/extent-cache.h
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2009-01-07 14:57:12 -0500
committerChris Mason <chris.mason@oracle.com>2009-01-07 14:57:12 -0500
commit9a6930e9bedb930ac44e540ef7f5633b61d270c2 (patch)
tree987d231e78c0144e08bbe1fe3b8cc4f69e67d22b /extent-cache.h
parent50e571e5b7ff95c94803c9668a8550ed68571db5 (diff)
downloadbtrfs-progs-9a6930e9bedb930ac44e540ef7f5633b61d270c2.tar.gz
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 <zheng.yan@oracle.com>
Diffstat (limited to 'extent-cache.h')
-rw-r--r--extent-cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/extent-cache.h b/extent-cache.h
index 4c468ce..7f2f2a6 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);