scoutfs-utils: add support for btree migration key

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-10-24 15:41:30 -07:00
committed by Mark Fasheh
parent 0acab247e3
commit 80e0c4bd56
2 changed files with 10 additions and 3 deletions

View File

@@ -103,10 +103,15 @@ struct scoutfs_btree_ref {
/*
* A height of X means that the first block read will have level X-1 and
* the leaves will have level 0.
*
* The migration key is used to walk the tree finding old blocks to migrate
* into the current half of the ring.
*/
struct scoutfs_btree_root {
struct scoutfs_btree_ref ref;
__u8 height;
__le16 migration_key_len;
__u8 migration_key[SCOUTFS_BTREE_MAX_KEY_LEN];
} __packed;
struct scoutfs_btree_item_header {

View File

@@ -562,8 +562,8 @@ static void print_super_block(struct scoutfs_super_block *super, u64 blkno)
" alloc_uninit %llu total_segs %llu free_segs %llu\n"
" btree ring: first_blkno %llu nr_blocks %llu next_block %llu "
"next_seq %llu\n"
" alloc btree root: height %u blkno %llu seq %llu\n"
" manifest btree root: height %u blkno %llu seq %llu\n",
" alloc btree root: height %u blkno %llu seq %llu mig_len %u\n"
" manifest btree root: height %u blkno %llu seq %llu mig_len %u\n",
le64_to_cpu(super->next_ino),
le64_to_cpu(super->next_seq),
le64_to_cpu(super->next_seg_seq),
@@ -577,9 +577,11 @@ static void print_super_block(struct scoutfs_super_block *super, u64 blkno)
super->alloc_root.height,
le64_to_cpu(super->alloc_root.ref.blkno),
le64_to_cpu(super->alloc_root.ref.seq),
le16_to_cpu(super->alloc_root.migration_key_len),
super->manifest.root.height,
le64_to_cpu(super->manifest.root.ref.blkno),
le64_to_cpu(super->manifest.root.ref.seq));
le64_to_cpu(super->manifest.root.ref.seq),
le16_to_cpu(super->manifest.root.migration_key_len));
printf(" level_counts:");
counts = super->manifest.level_counts;