summaryrefslogtreecommitdiff
path: root/debug-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-05-29 16:35:30 -0400
committerChris Mason <chris.mason@oracle.com>2009-06-08 13:30:36 -0400
commit95d3f20b51e9b2ee21822313ad4f31279396407b (patch)
treeb120e33ca9ad3f04a0a32b62451e6ba5926b2ca0 /debug-tree.c
parent2d39a83829bfc26f0c79b33fca64540c634f7f18 (diff)
Mixed back reference (FORWARD ROLLING FORMAT CHANGE)
This commit introduces a new kind of back reference for btrfs metadata. Once a filesystem has been mounted with this commit, IT WILL NO LONGER BE MOUNTABLE BY OLDER KERNELS. The new back ref provides information about pointer's key, level and in which tree the pointer lives. This information allow us to find the pointer by searching the tree. The shortcoming of the new back ref is that it only works for pointers in tree blocks referenced by their owner trees. This is mostly a problem for snapshots, where resolving one of these fuzzy back references would be O(number_of_snapshots) and quite slow. The solution used here is to use the fuzzy back references in the common case where a given tree block is only referenced by one root, and use the full back references when multiple roots have a reference
Diffstat (limited to 'debug-tree.c')
-rw-r--r--debug-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/debug-tree.c b/debug-tree.c
index e22d3f5b..1d475190 100644
--- a/debug-tree.c
+++ b/debug-tree.c
@@ -39,7 +39,7 @@ static void print_extent_leaf(struct btrfs_root *root, struct extent_buffer *l)
{
int i;
struct btrfs_item *item;
- struct btrfs_extent_ref *ref;
+// struct btrfs_extent_ref *ref;
struct btrfs_key key;
static u64 last = 0;
static u64 last_len = 0;
@@ -55,6 +55,7 @@ static void print_extent_leaf(struct btrfs_root *root, struct extent_buffer *l)
last_len = key.offset;
last = key.objectid;
break;
+#if 0
case BTRFS_EXTENT_REF_KEY:
ref = btrfs_item_ptr(l, i, struct btrfs_extent_ref);
printf("%llu %llu extent back ref root %llu gen %llu "
@@ -66,6 +67,7 @@ static void print_extent_leaf(struct btrfs_root *root, struct extent_buffer *l)
(unsigned long long)btrfs_ref_objectid(l, ref),
(unsigned long)btrfs_ref_num_refs(l, ref));
break;
+#endif
};
fflush(stdout);
}