Lines Matching refs:delayed_refs
56 atomic_read(&trans->transaction->delayed_refs.num_entries); in btrfs_should_throttle_delayed_refs()
394 int btrfs_delayed_ref_lock(struct btrfs_delayed_ref_root *delayed_refs, in btrfs_delayed_ref_lock() argument
397 lockdep_assert_held(&delayed_refs->lock); in btrfs_delayed_ref_lock()
402 spin_unlock(&delayed_refs->lock); in btrfs_delayed_ref_lock()
405 spin_lock(&delayed_refs->lock); in btrfs_delayed_ref_lock()
416 struct btrfs_delayed_ref_root *delayed_refs, in drop_delayed_ref() argument
427 atomic_dec(&delayed_refs->num_entries); in drop_delayed_ref()
431 struct btrfs_delayed_ref_root *delayed_refs, in merge_ref() argument
460 drop_delayed_ref(trans, delayed_refs, head, next); in merge_ref()
463 drop_delayed_ref(trans, delayed_refs, head, ref); in merge_ref()
478 struct btrfs_delayed_ref_root *delayed_refs, in btrfs_merge_delayed_refs() argument
511 if (merge_ref(trans, delayed_refs, head, ref, seq)) in btrfs_merge_delayed_refs()
539 struct btrfs_delayed_ref_root *delayed_refs) in btrfs_select_ref_head() argument
544 head = find_ref_head(delayed_refs, delayed_refs->run_delayed_start, in btrfs_select_ref_head()
546 if (!head && delayed_refs->run_delayed_start != 0) { in btrfs_select_ref_head()
547 delayed_refs->run_delayed_start = 0; in btrfs_select_ref_head()
548 head = find_first_ref_head(delayed_refs); in btrfs_select_ref_head()
558 if (delayed_refs->run_delayed_start == 0) in btrfs_select_ref_head()
560 delayed_refs->run_delayed_start = 0; in btrfs_select_ref_head()
568 WARN_ON(delayed_refs->num_heads_ready == 0); in btrfs_select_ref_head()
569 delayed_refs->num_heads_ready--; in btrfs_select_ref_head()
570 delayed_refs->run_delayed_start = head->bytenr + in btrfs_select_ref_head()
575 void btrfs_delete_ref_head(struct btrfs_delayed_ref_root *delayed_refs, in btrfs_delete_ref_head() argument
578 lockdep_assert_held(&delayed_refs->lock); in btrfs_delete_ref_head()
581 rb_erase_cached(&head->href_node, &delayed_refs->href_root); in btrfs_delete_ref_head()
583 atomic_dec(&delayed_refs->num_entries); in btrfs_delete_ref_head()
584 delayed_refs->num_heads--; in btrfs_delete_ref_head()
586 delayed_refs->num_heads_ready--; in btrfs_delete_ref_head()
655 struct btrfs_delayed_ref_root *delayed_refs = in update_existing_head_ref() local
656 &trans->transaction->delayed_refs; in update_existing_head_ref()
720 delayed_refs->pending_csums -= existing->num_bytes; in update_existing_head_ref()
724 delayed_refs->pending_csums += existing->num_bytes; in update_existing_head_ref()
806 struct btrfs_delayed_ref_root *delayed_refs; in add_delayed_ref_head() local
809 delayed_refs = &trans->transaction->delayed_refs; in add_delayed_ref_head()
814 delayed_refs, qrecord)) in add_delayed_ref_head()
822 existing = htree_insert(&delayed_refs->href_root, in add_delayed_ref_head()
837 delayed_refs->pending_csums += head_ref->num_bytes; in add_delayed_ref_head()
842 delayed_refs->num_heads++; in add_delayed_ref_head()
843 delayed_refs->num_heads_ready++; in add_delayed_ref_head()
844 atomic_inc(&delayed_refs->num_entries); in add_delayed_ref_head()
919 struct btrfs_delayed_ref_root *delayed_refs; in btrfs_add_delayed_tree_ref() local
973 delayed_refs = &trans->transaction->delayed_refs; in btrfs_add_delayed_tree_ref()
974 spin_lock(&delayed_refs->lock); in btrfs_add_delayed_tree_ref()
984 ret = insert_delayed_ref(trans, delayed_refs, head_ref, &ref->node); in btrfs_add_delayed_tree_ref()
985 spin_unlock(&delayed_refs->lock); in btrfs_add_delayed_tree_ref()
1016 struct btrfs_delayed_ref_root *delayed_refs; in btrfs_add_delayed_data_ref() local
1069 delayed_refs = &trans->transaction->delayed_refs; in btrfs_add_delayed_data_ref()
1070 spin_lock(&delayed_refs->lock); in btrfs_add_delayed_data_ref()
1080 ret = insert_delayed_ref(trans, delayed_refs, head_ref, &ref->node); in btrfs_add_delayed_data_ref()
1081 spin_unlock(&delayed_refs->lock); in btrfs_add_delayed_data_ref()
1106 struct btrfs_delayed_ref_root *delayed_refs; in btrfs_add_delayed_extent_op() local
1117 delayed_refs = &trans->transaction->delayed_refs; in btrfs_add_delayed_extent_op()
1118 spin_lock(&delayed_refs->lock); in btrfs_add_delayed_extent_op()
1123 spin_unlock(&delayed_refs->lock); in btrfs_add_delayed_extent_op()
1138 btrfs_find_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_refs, u64 bytenr) in btrfs_find_delayed_ref_head() argument
1140 lockdep_assert_held(&delayed_refs->lock); in btrfs_find_delayed_ref_head()
1142 return find_ref_head(delayed_refs, bytenr, false); in btrfs_find_delayed_ref_head()