Lines Matching refs:head_ref

763 static void init_delayed_ref_head(struct btrfs_delayed_ref_head *head_ref,  in init_delayed_ref_head()  argument
805 refcount_set(&head_ref->refs, 1); in init_delayed_ref_head()
806 head_ref->bytenr = generic_ref->bytenr; in init_delayed_ref_head()
807 head_ref->num_bytes = generic_ref->num_bytes; in init_delayed_ref_head()
808 head_ref->ref_mod = count_mod; in init_delayed_ref_head()
809 head_ref->reserved_bytes = reserved; in init_delayed_ref_head()
810 head_ref->must_insert_reserved = must_insert_reserved; in init_delayed_ref_head()
811 head_ref->owning_root = generic_ref->owning_root; in init_delayed_ref_head()
812 head_ref->is_data = (generic_ref->type == BTRFS_REF_DATA); in init_delayed_ref_head()
813 head_ref->is_system = (generic_ref->ref_root == BTRFS_CHUNK_TREE_OBJECTID); in init_delayed_ref_head()
814 head_ref->ref_tree = RB_ROOT_CACHED; in init_delayed_ref_head()
815 INIT_LIST_HEAD(&head_ref->ref_add_list); in init_delayed_ref_head()
816 RB_CLEAR_NODE(&head_ref->href_node); in init_delayed_ref_head()
817 head_ref->processing = false; in init_delayed_ref_head()
818 head_ref->total_ref_mod = count_mod; in init_delayed_ref_head()
819 spin_lock_init(&head_ref->lock); in init_delayed_ref_head()
820 mutex_init(&head_ref->mutex); in init_delayed_ref_head()
824 head_ref->level = generic_ref->tree_ref.level; in init_delayed_ref_head()
826 head_ref->level = U8_MAX; in init_delayed_ref_head()
848 struct btrfs_delayed_ref_head *head_ref, in add_delayed_ref_head() argument
877 trace_add_delayed_ref_head(fs_info, head_ref, action); in add_delayed_ref_head()
880 &head_ref->href_node); in add_delayed_ref_head()
882 update_existing_head_ref(trans, existing, head_ref); in add_delayed_ref_head()
887 kmem_cache_free(btrfs_delayed_ref_head_cachep, head_ref); in add_delayed_ref_head()
888 head_ref = existing; in add_delayed_ref_head()
896 if (head_ref->is_data && head_ref->ref_mod < 0) { in add_delayed_ref_head()
897 delayed_refs->pending_csums += head_ref->num_bytes; in add_delayed_ref_head()
899 btrfs_csum_bytes_to_leaves(fs_info, head_ref->num_bytes); in add_delayed_ref_head()
908 return head_ref; in add_delayed_ref_head()
1007 struct btrfs_delayed_ref_head *head_ref; in add_delayed_ref() local
1020 head_ref = kmem_cache_alloc(btrfs_delayed_ref_head_cachep, GFP_NOFS); in add_delayed_ref()
1021 if (!head_ref) { in add_delayed_ref()
1041 init_delayed_ref_head(head_ref, generic_ref, record, reserved); in add_delayed_ref()
1042 head_ref->extent_op = extent_op; in add_delayed_ref()
1051 new_head_ref = add_delayed_ref_head(trans, head_ref, record, in add_delayed_ref()
1058 head_ref = new_head_ref; in add_delayed_ref()
1060 merged = insert_delayed_ref(trans, head_ref, node); in add_delayed_ref()
1083 kmem_cache_free(btrfs_delayed_ref_head_cachep, head_ref); in add_delayed_ref()
1116 struct btrfs_delayed_ref_head *head_ref; in btrfs_add_delayed_extent_op() local
1127 head_ref = kmem_cache_alloc(btrfs_delayed_ref_head_cachep, GFP_NOFS); in btrfs_add_delayed_extent_op()
1128 if (!head_ref) in btrfs_add_delayed_extent_op()
1131 init_delayed_ref_head(head_ref, &generic_ref, NULL, 0); in btrfs_add_delayed_extent_op()
1132 head_ref->extent_op = extent_op; in btrfs_add_delayed_extent_op()
1137 head_ref_ret = add_delayed_ref_head(trans, head_ref, NULL, in btrfs_add_delayed_extent_op()
1142 kmem_cache_free(btrfs_delayed_ref_head_cachep, head_ref); in btrfs_add_delayed_extent_op()