Lines Matching refs:existing
656 struct btrfs_delayed_ref_head *existing, in update_existing_head_ref() argument
664 BUG_ON(existing->is_data != update->is_data); in update_existing_head_ref()
666 spin_lock(&existing->lock); in update_existing_head_ref()
675 existing->must_insert_reserved = update->must_insert_reserved; in update_existing_head_ref()
681 existing->num_bytes = update->num_bytes; in update_existing_head_ref()
686 if (!existing->extent_op) { in update_existing_head_ref()
687 existing->extent_op = update->extent_op; in update_existing_head_ref()
690 memcpy(&existing->extent_op->key, in update_existing_head_ref()
693 existing->extent_op->update_key = true; in update_existing_head_ref()
696 existing->extent_op->flags_to_set |= in update_existing_head_ref()
698 existing->extent_op->update_flags = true; in update_existing_head_ref()
708 old_ref_mod = existing->total_ref_mod; in update_existing_head_ref()
709 existing->ref_mod += update->ref_mod; in update_existing_head_ref()
710 existing->total_ref_mod += update->ref_mod; in update_existing_head_ref()
716 if (existing->is_data) { in update_existing_head_ref()
719 existing->num_bytes); in update_existing_head_ref()
721 if (existing->total_ref_mod >= 0 && old_ref_mod < 0) { in update_existing_head_ref()
722 delayed_refs->pending_csums -= existing->num_bytes; in update_existing_head_ref()
725 if (existing->total_ref_mod < 0 && old_ref_mod >= 0) { in update_existing_head_ref()
726 delayed_refs->pending_csums += existing->num_bytes; in update_existing_head_ref()
731 spin_unlock(&existing->lock); in update_existing_head_ref()
807 struct btrfs_delayed_ref_head *existing; in add_delayed_ref_head() local
824 existing = htree_insert(&delayed_refs->href_root, in add_delayed_ref_head()
826 if (existing) { in add_delayed_ref_head()
827 update_existing_head_ref(trans, existing, head_ref); in add_delayed_ref_head()
833 head_ref = existing; in add_delayed_ref_head()