Lines Matching full:existing
683 * Return true if the ref was merged into an existing one (and therefore can be
728 /* remove existing tail if its ref_mod is zero */ in insert_delayed_ref()
737 * existing and update must have the same bytenr
740 struct btrfs_delayed_ref_head *existing, in update_existing_head_ref() argument
748 BUG_ON(existing->is_data != update->is_data); in update_existing_head_ref()
750 spin_lock(&existing->lock); in update_existing_head_ref()
757 if (!existing->owning_root) in update_existing_head_ref()
758 existing->owning_root = update->owning_root; in update_existing_head_ref()
764 * with an existing head ref without in update_existing_head_ref()
768 existing->must_insert_reserved = update->must_insert_reserved; in update_existing_head_ref()
769 existing->owning_root = update->owning_root; in update_existing_head_ref()
775 existing->num_bytes = update->num_bytes; in update_existing_head_ref()
780 if (!existing->extent_op) { in update_existing_head_ref()
781 existing->extent_op = update->extent_op; in update_existing_head_ref()
784 memcpy(&existing->extent_op->key, in update_existing_head_ref()
787 existing->extent_op->update_key = true; in update_existing_head_ref()
790 existing->extent_op->flags_to_set |= in update_existing_head_ref()
792 existing->extent_op->update_flags = true; in update_existing_head_ref()
802 old_ref_mod = existing->total_ref_mod; in update_existing_head_ref()
803 existing->ref_mod += update->ref_mod; in update_existing_head_ref()
804 existing->total_ref_mod += update->ref_mod; in update_existing_head_ref()
812 if (existing->is_data) { in update_existing_head_ref()
815 existing->num_bytes); in update_existing_head_ref()
817 if (existing->total_ref_mod >= 0 && old_ref_mod < 0) { in update_existing_head_ref()
818 delayed_refs->pending_csums -= existing->num_bytes; in update_existing_head_ref()
821 if (existing->total_ref_mod < 0 && old_ref_mod >= 0) { in update_existing_head_ref()
822 delayed_refs->pending_csums += existing->num_bytes; in update_existing_head_ref()
827 spin_unlock(&existing->lock); in update_existing_head_ref()
909 struct btrfs_delayed_ref_head *existing; in add_delayed_ref_head() local
926 existing = htree_insert(&delayed_refs->href_root, in add_delayed_ref_head()
928 if (existing) { in add_delayed_ref_head()
929 update_existing_head_ref(trans, existing, head_ref); in add_delayed_ref_head()
931 * we've updated the existing ref, free the newly in add_delayed_ref_head()
935 head_ref = existing; in add_delayed_ref_head()