summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-06-08 15:47:47 +0300
committerDavid Sterba <dsterba@suse.com>2018-08-06 15:01:51 +0200
commit3a0cf26beed04189a51d7e7f5a94bf3c7736fafc (patch)
tree757cdd3e94eff72ff81d279b24d4f635df4b1b3f /extent-tree.c
parent4d918a7299459174dec85f2056eb11c087dd7dbf (diff)
btrfs-progs: Refactor the root used bytes are updated
Instead of updating this during update_block_group, move the updating code at the places where we free/allocate a block. This resembles the current state of the kernel code. This is in prep for delayed refs. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/extent-tree.c b/extent-tree.c
index c6f09b5..07b5fb9 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -1932,14 +1932,6 @@ static int update_block_group(struct btrfs_root *root,
old_val -= num_bytes;
btrfs_set_super_bytes_used(info->super_copy, old_val);
- /* block accounting for root item */
- old_val = btrfs_root_used(&root->root_item);
- if (alloc)
- old_val += num_bytes;
- else
- old_val -= num_bytes;
- btrfs_set_root_used(&root->root_item, old_val);
-
while(total) {
cache = btrfs_lookup_block_group(info, bytenr);
if (!cache) {