summaryrefslogtreecommitdiff
path: root/fs/btrfs/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-15 15:41:47 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:01 -0400
commite17cade25ff8074101d653557a78df09c16ca276 (patch)
treec4bddc201bf77c9a460e726a5cdd5ca1add8c256 /fs/btrfs/print-tree.c
parentb248a4152956cbae1b23f4c70ef5b51d6ea2ecfb (diff)
downloadlinux-3.10-e17cade25ff8074101d653557a78df09c16ca276.tar.gz
linux-3.10-e17cade25ff8074101d653557a78df09c16ca276.tar.bz2
linux-3.10-e17cade25ff8074101d653557a78df09c16ca276.zip
Btrfs: Add chunk uuids and update multi-device back references
Block headers now store the chunk tree uuid Chunk items records the device uuid for each stripes Device extent items record better back refs to the chunk tree Block groups record better back refs to the chunk tree The chunk tree format has also changed. The objectid of BTRFS_CHUNK_ITEM_KEY used to be the logical offset of the chunk. Now it is a chunk tree id, with the logical offset being stored in the offset field of the key. This allows a single chunk tree to record multiple logical address spaces, upping the number of bytes indexed by a chunk tree from 2^64 to 2^128. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/print-tree.c')
-rw-r--r--fs/btrfs/print-tree.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index ee0de112cf5..e99f3249d05 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -24,7 +24,8 @@ static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
{
int num_stripes = btrfs_chunk_num_stripes(eb, chunk);
int i;
- printk("\t\tchunk owner %llu type %llu num_stripes %d\n",
+ printk("\t\tchunk length %llu owner %llu type %llu num_stripes %d\n",
+ (unsigned long long)btrfs_chunk_length(eb, chunk),
(unsigned long long)btrfs_chunk_owner(eb, chunk),
(unsigned long long)btrfs_chunk_type(eb, chunk),
num_stripes);
@@ -140,17 +141,24 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
case BTRFS_DEV_EXTENT_KEY:
dev_extent = btrfs_item_ptr(l, i,
struct btrfs_dev_extent);
- printk("\t\tdev extent owner %llu length %llu\n",
- (unsigned long long)btrfs_dev_extent_owner(l, dev_extent),
- (unsigned long long)btrfs_dev_extent_length(l, dev_extent));
+ printk("\t\tdev extent chunk_tree %llu\n"
+ "\t\tchunk objectid %llu chunk offset %llu "
+ "length %llu\n",
+ (unsigned long long)
+ btrfs_dev_extent_chunk_tree(l, dev_extent),
+ (unsigned long long)
+ btrfs_dev_extent_chunk_objectid(l, dev_extent),
+ (unsigned long long)
+ btrfs_dev_extent_chunk_offset(l, dev_extent),
+ (unsigned long long)
+ btrfs_dev_extent_length(l, dev_extent));
};
}
}
void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
{
- int i;
- u32 nr;
+ int i; u32 nr;
struct btrfs_key key;
int level;