Btrfs: Full back reference support

This patch makes the back reference system to explicit record the
location of parent node for all types of extents. The location of
parent node is placed into the offset field of backref key. Every
time a tree block is balanced, the back references for the affected
lower level extents are updated.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Zheng Yan
2008-09-23 13:14:14 -04:00
committed by Chris Mason
parent 1c2308f8e7
commit 31840ae1a6
10 changed files with 1066 additions and 722 deletions

View File

@@ -102,11 +102,12 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
case BTRFS_EXTENT_REF_KEY:
ref = btrfs_item_ptr(l, i, struct btrfs_extent_ref);
printk("\t\textent back ref root %llu gen %llu "
"owner %llu offset %llu\n",
"owner %llu offset %llu num_refs %lu\n",
(unsigned long long)btrfs_ref_root(l, ref),
(unsigned long long)btrfs_ref_generation(l, ref),
(unsigned long long)btrfs_ref_objectid(l, ref),
(unsigned long long)btrfs_ref_offset(l, ref));
(unsigned long long)btrfs_ref_offset(l, ref),
(unsigned long)btrfs_ref_num_refs(l, ref));
break;
case BTRFS_EXTENT_DATA_KEY: