/*
* For (parent_gen > 0 && parent_gen > ref_gen):
*
- * we reach here through the oldest root, therefore
- * all other reference from same snapshot should have
+ * we reach here through the oldest root, therefore
+ * all other reference from same snapshot should have
* a larger generation.
*/
if ((root_objectid != btrfs_ref_root(leaf, ref_item)) ||
if (!eb)
continue;
extent_start = eb->start;
- } else
+ } else
extent_start = bytenr;
ret = get_reference_status(root, extent_start, ref_generation,
struct btrfs_leaf_ref *ref;
struct btrfs_extent_info *info;
- ref = btrfs_alloc_leaf_ref(nr_file_extents);
+ ref = btrfs_alloc_leaf_ref(root, nr_file_extents);
if (!ref) {
WARN_ON(1);
goto out;
ref->generation = btrfs_header_generation(buf);
ref->nritems = nr_file_extents;
info = ref->extents;
-
+
for (i = 0; nr_file_extents > 0 && i < nritems; i++) {
u64 disk_bytenr;
btrfs_item_key_to_cpu(buf, &key, i);
BUG_ON(!root->ref_tree);
ret = btrfs_add_leaf_ref(root, ref);
WARN_ON(ret);
- btrfs_free_leaf_ref(ref);
+ btrfs_free_leaf_ref(root, ref);
}
out:
return 0;
}
static int noinline drop_leaf_ref_no_cache(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
+ struct btrfs_root *root,
struct extent_buffer *leaf)
{
u64 leaf_owner;
}
static int noinline drop_leaf_ref(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
+ struct btrfs_root *root,
struct btrfs_leaf_ref *ref)
{
int i;
ret = drop_leaf_ref(trans, root, ref);
BUG_ON(ret);
btrfs_remove_leaf_ref(root, ref);
- btrfs_free_leaf_ref(ref);
+ btrfs_free_leaf_ref(root, ref);
*level = 0;
break;
}