• Home
  • Raw
  • Download

Lines Matching refs:cow

203 	struct extent_buffer *cow;  in btrfs_copy_root()  local
219 cow = btrfs_alloc_tree_block(trans, root, 0, new_root_objectid, in btrfs_copy_root()
222 if (IS_ERR(cow)) in btrfs_copy_root()
223 return PTR_ERR(cow); in btrfs_copy_root()
225 copy_extent_buffer_full(cow, buf); in btrfs_copy_root()
226 btrfs_set_header_bytenr(cow, cow->start); in btrfs_copy_root()
227 btrfs_set_header_generation(cow, trans->transid); in btrfs_copy_root()
228 btrfs_set_header_backref_rev(cow, BTRFS_MIXED_BACKREF_REV); in btrfs_copy_root()
229 btrfs_clear_header_flag(cow, BTRFS_HEADER_FLAG_WRITTEN | in btrfs_copy_root()
232 btrfs_set_header_flag(cow, BTRFS_HEADER_FLAG_RELOC); in btrfs_copy_root()
234 btrfs_set_header_owner(cow, new_root_objectid); in btrfs_copy_root()
236 write_extent_buffer_fsid(cow, fs_info->fs_devices->metadata_uuid); in btrfs_copy_root()
240 ret = btrfs_inc_ref(trans, root, cow, 1); in btrfs_copy_root()
242 ret = btrfs_inc_ref(trans, root, cow, 0); in btrfs_copy_root()
244 btrfs_tree_unlock(cow); in btrfs_copy_root()
245 free_extent_buffer(cow); in btrfs_copy_root()
250 btrfs_mark_buffer_dirty(cow); in btrfs_copy_root()
251 *cow_ret = cow; in btrfs_copy_root()
279 struct extent_buffer *cow, in update_ref_for_cow() argument
343 ret = btrfs_inc_ref(trans, root, cow, 1); in update_ref_for_cow()
352 ret = btrfs_inc_ref(trans, root, cow, 1); in update_ref_for_cow()
354 ret = btrfs_inc_ref(trans, root, cow, 0); in update_ref_for_cow()
370 ret = btrfs_inc_ref(trans, root, cow, 1); in update_ref_for_cow()
372 ret = btrfs_inc_ref(trans, root, cow, 0); in update_ref_for_cow()
407 struct extent_buffer *cow; in __btrfs_cow_block() local
433 cow = btrfs_alloc_tree_block(trans, root, parent_start, in __btrfs_cow_block()
436 if (IS_ERR(cow)) in __btrfs_cow_block()
437 return PTR_ERR(cow); in __btrfs_cow_block()
441 copy_extent_buffer_full(cow, buf); in __btrfs_cow_block()
442 btrfs_set_header_bytenr(cow, cow->start); in __btrfs_cow_block()
443 btrfs_set_header_generation(cow, trans->transid); in __btrfs_cow_block()
444 btrfs_set_header_backref_rev(cow, BTRFS_MIXED_BACKREF_REV); in __btrfs_cow_block()
445 btrfs_clear_header_flag(cow, BTRFS_HEADER_FLAG_WRITTEN | in __btrfs_cow_block()
448 btrfs_set_header_flag(cow, BTRFS_HEADER_FLAG_RELOC); in __btrfs_cow_block()
450 btrfs_set_header_owner(cow, root->root_key.objectid); in __btrfs_cow_block()
452 write_extent_buffer_fsid(cow, fs_info->fs_devices->metadata_uuid); in __btrfs_cow_block()
454 ret = update_ref_for_cow(trans, root, buf, cow, &last_ref); in __btrfs_cow_block()
456 btrfs_tree_unlock(cow); in __btrfs_cow_block()
457 free_extent_buffer(cow); in __btrfs_cow_block()
463 ret = btrfs_reloc_cow_block(trans, root, buf, cow); in __btrfs_cow_block()
465 btrfs_tree_unlock(cow); in __btrfs_cow_block()
466 free_extent_buffer(cow); in __btrfs_cow_block()
478 ret = btrfs_tree_mod_log_insert_root(root->node, cow, true); in __btrfs_cow_block()
480 btrfs_tree_unlock(cow); in __btrfs_cow_block()
481 free_extent_buffer(cow); in __btrfs_cow_block()
485 atomic_inc(&cow->refs); in __btrfs_cow_block()
486 rcu_assign_pointer(root->node, cow); in __btrfs_cow_block()
497 cow->start); in __btrfs_cow_block()
504 btrfs_tree_unlock(cow); in __btrfs_cow_block()
505 free_extent_buffer(cow); in __btrfs_cow_block()
516 btrfs_mark_buffer_dirty(cow); in __btrfs_cow_block()
517 *cow_ret = cow; in __btrfs_cow_block()
1964 int ins_len, int cow) in btrfs_search_slot() argument
1982 BUG_ON(!cow && ins_len); in btrfs_search_slot()
1989 ASSERT(!p->nowait || !cow); in btrfs_search_slot()
2007 if (!cow) in btrfs_search_slot()
2010 if (cow && (p->keep_locks || p->lowest_level)) in btrfs_search_slot()
2038 if (cow) { in btrfs_search_slot()