From ffaff17911e4eb0c6177aa4661f90734f7af7b54 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 29 Aug 2007 15:56:44 -0400 Subject: btrfs-progs support for root block accounting This adds support for keeping track of the number of blocks used by root_item's. This makes it so that mkfs lays down the "default" subvol with the correct block accounting in place. Thank you, --- ctree.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ctree.h') diff --git a/ctree.h b/ctree.h index fc84de32..7be96c44 100644 --- a/ctree.h +++ b/ctree.h @@ -784,6 +784,17 @@ static inline void btrfs_set_root_flags(struct btrfs_root_item *item, u32 val) item->flags = cpu_to_le32(val); } +static inline void btrfs_set_root_blocks_used(struct btrfs_root_item *item, + u64 val) +{ + item->blocks_used = cpu_to_le64(val); +} + +static inline u64 btrfs_root_blocks_used(struct btrfs_root_item *item) +{ + return le64_to_cpu(item->blocks_used); +} + static inline u64 btrfs_super_blocknr(struct btrfs_super_block *s) { return le64_to_cpu(s->blocknr); -- cgit v1.2.3