printf("\t\ttype %s num_stripes %d\n",
chunk_flags_str, num_stripes);
for (i = 0 ; i < num_stripes ; i++) {
+ unsigned char dev_uuid[BTRFS_UUID_SIZE];
+ char str_dev_uuid[BTRFS_UUID_UNPARSED_SIZE];
+
+ read_extent_buffer(eb, dev_uuid,
+ (unsigned long)btrfs_stripe_dev_uuid_nr(chunk, i),
+ BTRFS_UUID_SIZE);
+ uuid_unparse(dev_uuid, str_dev_uuid);
printf("\t\t\tstripe %d devid %llu offset %llu\n", i,
(unsigned long long)btrfs_stripe_devid_nr(eb, chunk, i),
(unsigned long long)btrfs_stripe_offset_nr(eb, chunk, i));
+ printf("\t\t\tdev uuid: %s\n", str_dev_uuid);
}
}
printf("fs uuid %s\nchunk uuid %s\n", fs_uuid, chunk_uuid);
}
+static void compress_type_to_str(u8 compress_type, char *ret)
+{
+ switch (compress_type) {
+ case BTRFS_COMPRESS_NONE:
+ strcpy(ret, "none");
+ break;
+ case BTRFS_COMPRESS_ZLIB:
+ strcpy(ret, "zlib");
+ break;
+ case BTRFS_COMPRESS_LZO:
+ strcpy(ret, "lzo");
+ break;
+ default:
+ sprintf(ret, "UNKNOWN.%d", compress_type);
+ }
+}
+
static void print_file_extent_item(struct extent_buffer *eb,
struct btrfs_item *item,
int slot,
struct btrfs_file_extent_item *fi)
{
int extent_type = btrfs_file_extent_type(eb, fi);
+ char compress_str[16];
+
+ compress_type_to_str(btrfs_file_extent_compression(eb, fi),
+ compress_str);
if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
printf("\t\tinline extent data size %u "
- "ram %u compress %d\n",
+ "ram %u compress(%s)\n",
btrfs_file_extent_inline_item_len(eb, item),
btrfs_file_extent_inline_len(eb, slot, fi),
- btrfs_file_extent_compression(eb, fi));
+ compress_str);
return;
}
if (extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
(unsigned long long)btrfs_file_extent_offset(eb, fi),
(unsigned long long)btrfs_file_extent_num_bytes(eb, fi),
(unsigned long long)btrfs_file_extent_ram_bytes(eb, fi));
- printf("\t\textent compression %d\n",
- btrfs_file_extent_compression(eb, fi));
+ printf("\t\textent compression(%s)\n", compress_str);
}
/* Caller should ensure sizeof(*ret) >= 16("DATA|TREE_BLOCK") */
case BTRFS_BLOCK_GROUP_ITEM_KEY:
printf("BLOCK_GROUP_ITEM");
break;
+ case BTRFS_FREE_SPACE_INFO_KEY:
+ printf("FREE_SPACE_INFO");
+ break;
+ case BTRFS_FREE_SPACE_EXTENT_KEY:
+ printf("FREE_SPACE_EXTENT");
+ break;
+ case BTRFS_FREE_SPACE_BITMAP_KEY:
+ printf("FREE_SPACE_BITMAP");
+ break;
case BTRFS_CHUNK_ITEM_KEY:
printf("CHUNK_ITEM");
break;
case BTRFS_UUID_TREE_OBJECTID:
printf("UUID_TREE");
break;
+ case BTRFS_FREE_SPACE_TREE_OBJECTID:
+ printf("FREE_SPACE_TREE");
+ break;
case BTRFS_MULTIPLE_OBJECTIDS:
printf("MULTIPLE");
break;
struct btrfs_dev_extent *dev_extent;
struct btrfs_disk_key disk_key;
struct btrfs_block_group_item bg_item;
+ struct btrfs_free_space_info *free_info;
struct btrfs_dir_log_item *dlog;
struct btrfs_qgroup_info_item *qg_info;
struct btrfs_qgroup_limit_item *qg_limit;
(unsigned long long)btrfs_block_group_chunk_objectid(&bg_item),
flags_str);
break;
+ case BTRFS_FREE_SPACE_INFO_KEY:
+ free_info = btrfs_item_ptr(l, i, struct btrfs_free_space_info);
+ printf("\t\tfree space info extent count %u flags %u\n",
+ (unsigned)btrfs_free_space_extent_count(l, free_info),
+ (unsigned)btrfs_free_space_flags(l, free_info));
+ break;
+ case BTRFS_FREE_SPACE_EXTENT_KEY:
+ printf("\t\tfree space extent\n");
+ break;
+ case BTRFS_FREE_SPACE_BITMAP_KEY:
+ printf("\t\tfree space bitmap\n");
+ break;
case BTRFS_CHUNK_ITEM_KEY:
print_chunk(l, btrfs_item_ptr(l, i, struct btrfs_chunk));
break;
btrfs_qgroup_status_generation(l, qg_status),
flags_str,
(unsigned long long)
- btrfs_qgroup_status_scan(l, qg_status));
+ btrfs_qgroup_status_rescan(l, qg_status));
break;
case BTRFS_QGROUP_RELATION_KEY:
break;
(unsigned long long)btrfs_header_owner(eb));
print_uuids(eb);
fflush(stdout);
- size = btrfs_level_size(root, btrfs_header_level(eb) - 1);
+ size = root->nodesize;
for (i = 0; i < nr; i++) {
u64 blocknr = btrfs_node_blockptr(eb, i);
btrfs_node_key(eb, &disk_key, i);