Lines Matching refs:block

24 #include "block-group.h"
2172 * Helper function to trace a subtree tree block swap.
2174 * The swap will happen in highest tree block, but there may be a lot of
2340 * While during search, old tree blocks OO(c) will be skipped as tree block swap
2365 /* Read the tree block if needed */
2407 /* Now record this tree block and its counter part for qgroups */
2502 * The root tree block is specified by @root_eb.
2504 * Normally used by relocation(tree block swap) and subvolume deletion.
2567 * extent block.
4587 * @bg: block group under balance
4602 struct btrfs_qgroup_swapped_block *block;
4621 block = kmalloc(sizeof(*block), GFP_NOFS);
4622 if (!block) {
4628 * @reloc_parent/slot is still before swap, while @block is going to
4631 block->subvol_bytenr = btrfs_node_blockptr(reloc_parent, reloc_slot);
4632 block->subvol_generation = btrfs_node_ptr_generation(reloc_parent,
4634 block->reloc_bytenr = btrfs_node_blockptr(subvol_parent, subvol_slot);
4635 block->reloc_generation = btrfs_node_ptr_generation(subvol_parent,
4637 block->last_snapshot = last_snapshot;
4638 block->level = level;
4646 block->trace_leaf = true;
4648 block->trace_leaf = false;
4649 btrfs_node_key_to_cpu(reloc_parent, &block->first_key, reloc_slot);
4651 /* Insert @block into @blocks */
4661 if (entry->subvol_bytenr < block->subvol_bytenr) {
4663 } else if (entry->subvol_bytenr > block->subvol_bytenr) {
4667 block->subvol_generation ||
4668 entry->reloc_bytenr != block->reloc_bytenr ||
4670 block->reloc_generation) {
4681 kfree(block);
4685 rb_link_node(&block->node, parent, cur);
4686 rb_insert_color(&block->node, &blocks->blocks[level]);
4697 * Check if the tree block is a subtree root, and if so do the needed
4709 struct btrfs_qgroup_swapped_block *block;
4731 block = rb_entry(node, struct btrfs_qgroup_swapped_block, node);
4732 if (block->subvol_bytenr < subvol_eb->start) {
4734 } else if (block->subvol_bytenr > subvol_eb->start) {
4746 rb_erase(&block->node, &blocks->blocks[level]);
4756 check.level = block->level;
4757 check.transid = block->reloc_generation;
4759 memcpy(&check.first_key, &block->first_key, sizeof(check.first_key));
4762 reloc_eb = read_tree_block(fs_info, block->reloc_bytenr, &check);
4774 block->last_snapshot, block->trace_leaf);
4776 kfree(block);