Lines Matching refs:existing
673 struct btrfs_delayed_ref_head *existing, in update_existing_head_ref() argument
681 BUG_ON(existing->is_data != update->is_data); in update_existing_head_ref()
683 spin_lock(&existing->lock); in update_existing_head_ref()
690 if (!existing->owning_root) in update_existing_head_ref()
691 existing->owning_root = update->owning_root; in update_existing_head_ref()
701 existing->must_insert_reserved = update->must_insert_reserved; in update_existing_head_ref()
702 existing->owning_root = update->owning_root; in update_existing_head_ref()
708 existing->num_bytes = update->num_bytes; in update_existing_head_ref()
713 if (!existing->extent_op) { in update_existing_head_ref()
714 existing->extent_op = update->extent_op; in update_existing_head_ref()
717 memcpy(&existing->extent_op->key, in update_existing_head_ref()
720 existing->extent_op->update_key = true; in update_existing_head_ref()
723 existing->extent_op->flags_to_set |= in update_existing_head_ref()
725 existing->extent_op->update_flags = true; in update_existing_head_ref()
735 old_ref_mod = existing->total_ref_mod; in update_existing_head_ref()
736 existing->ref_mod += update->ref_mod; in update_existing_head_ref()
737 existing->total_ref_mod += update->ref_mod; in update_existing_head_ref()
745 if (existing->is_data) { in update_existing_head_ref()
748 existing->num_bytes); in update_existing_head_ref()
750 if (existing->total_ref_mod >= 0 && old_ref_mod < 0) { in update_existing_head_ref()
751 delayed_refs->pending_csums -= existing->num_bytes; in update_existing_head_ref()
754 if (existing->total_ref_mod < 0 && old_ref_mod >= 0) { in update_existing_head_ref()
755 delayed_refs->pending_csums += existing->num_bytes; in update_existing_head_ref()
760 spin_unlock(&existing->lock); in update_existing_head_ref()
853 struct btrfs_delayed_ref_head *existing; in add_delayed_ref_head() local
879 existing = htree_insert(&delayed_refs->href_root, in add_delayed_ref_head()
881 if (existing) { in add_delayed_ref_head()
882 update_existing_head_ref(trans, existing, head_ref); in add_delayed_ref_head()
888 head_ref = existing; in add_delayed_ref_head()