diff --git a/ctree.h b/ctree.h index efd044a2..c3f8c525 100644 --- a/ctree.h +++ b/ctree.h @@ -167,6 +167,7 @@ struct btrfs_inode_item { __le64 generation; __le64 size; __le64 nblocks; + __le64 block_group; __le32 nlink; __le32 uid; __le32 gid; @@ -392,6 +393,17 @@ static inline void btrfs_set_inode_nblocks(struct btrfs_inode_item *i, u64 val) i->nblocks = cpu_to_le64(val); } +static inline u64 btrfs_inode_block_group(struct btrfs_inode_item *i) +{ + return le64_to_cpu(i->block_group); +} + +static inline void btrfs_set_inode_block_group(struct btrfs_inode_item *i, + u64 val) +{ + i->block_group = cpu_to_le64(val); +} + static inline u32 btrfs_inode_nlink(struct btrfs_inode_item *i) { return le32_to_cpu(i->nlink); diff --git a/print-tree.c b/print-tree.c index 0b4d8059..c313a0a9 100644 --- a/print-tree.c +++ b/print-tree.c @@ -59,9 +59,10 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l) switch (type) { case BTRFS_INODE_ITEM_KEY: ii = btrfs_item_ptr(l, i, struct btrfs_inode_item); - printf("\t\tinode generation %Lu size %Lu mode %o\n", + printf("\t\tinode generation %Lu size %Lu block group %Lu mode %o\n", btrfs_inode_generation(ii), btrfs_inode_size(ii), + btrfs_inode_block_group(ii), btrfs_inode_mode(ii)); break; case BTRFS_DIR_ITEM_KEY: