Lines Matching refs:existing_ref
496 struct btrfs_delayed_ref_head *existing_ref; in update_existing_head_ref() local
500 existing_ref = btrfs_delayed_node_to_head(existing); in update_existing_head_ref()
502 BUG_ON(existing_ref->is_data != ref->is_data); in update_existing_head_ref()
504 spin_lock(&existing_ref->lock); in update_existing_head_ref()
513 existing_ref->must_insert_reserved = ref->must_insert_reserved; in update_existing_head_ref()
524 if (!existing_ref->extent_op) { in update_existing_head_ref()
525 existing_ref->extent_op = ref->extent_op; in update_existing_head_ref()
528 memcpy(&existing_ref->extent_op->key, in update_existing_head_ref()
531 existing_ref->extent_op->update_key = 1; in update_existing_head_ref()
534 existing_ref->extent_op->flags_to_set |= in update_existing_head_ref()
536 existing_ref->extent_op->update_flags = 1; in update_existing_head_ref()
546 old_ref_mod = existing_ref->total_ref_mod; in update_existing_head_ref()
548 existing_ref->total_ref_mod += update->ref_mod; in update_existing_head_ref()
554 if (existing_ref->is_data) { in update_existing_head_ref()
555 if (existing_ref->total_ref_mod >= 0 && old_ref_mod < 0) in update_existing_head_ref()
557 if (existing_ref->total_ref_mod < 0 && old_ref_mod >= 0) in update_existing_head_ref()
560 spin_unlock(&existing_ref->lock); in update_existing_head_ref()