Lines Matching refs:head_ref
716 static void init_delayed_ref_head(struct btrfs_delayed_ref_head *head_ref, in init_delayed_ref_head() argument
752 refcount_set(&head_ref->refs, 1); in init_delayed_ref_head()
753 head_ref->bytenr = bytenr; in init_delayed_ref_head()
754 head_ref->num_bytes = num_bytes; in init_delayed_ref_head()
755 head_ref->ref_mod = count_mod; in init_delayed_ref_head()
756 head_ref->must_insert_reserved = must_insert_reserved; in init_delayed_ref_head()
757 head_ref->is_data = is_data; in init_delayed_ref_head()
758 head_ref->is_system = is_system; in init_delayed_ref_head()
759 head_ref->ref_tree = RB_ROOT_CACHED; in init_delayed_ref_head()
760 INIT_LIST_HEAD(&head_ref->ref_add_list); in init_delayed_ref_head()
761 RB_CLEAR_NODE(&head_ref->href_node); in init_delayed_ref_head()
762 head_ref->processing = 0; in init_delayed_ref_head()
763 head_ref->total_ref_mod = count_mod; in init_delayed_ref_head()
764 spin_lock_init(&head_ref->lock); in init_delayed_ref_head()
765 mutex_init(&head_ref->mutex); in init_delayed_ref_head()
785 struct btrfs_delayed_ref_head *head_ref, in add_delayed_ref_head() argument
804 trace_add_delayed_ref_head(trans->fs_info, head_ref, action); in add_delayed_ref_head()
807 &head_ref->href_node); in add_delayed_ref_head()
809 update_existing_head_ref(trans, existing, head_ref); in add_delayed_ref_head()
814 kmem_cache_free(btrfs_delayed_ref_head_cachep, head_ref); in add_delayed_ref_head()
815 head_ref = existing; in add_delayed_ref_head()
817 if (head_ref->is_data && head_ref->ref_mod < 0) { in add_delayed_ref_head()
818 delayed_refs->pending_csums += head_ref->num_bytes; in add_delayed_ref_head()
821 head_ref->num_bytes); in add_delayed_ref_head()
831 return head_ref; in add_delayed_ref_head()
896 struct btrfs_delayed_ref_head *head_ref; in btrfs_add_delayed_tree_ref() local
917 head_ref = kmem_cache_alloc(btrfs_delayed_ref_head_cachep, GFP_NOFS); in btrfs_add_delayed_tree_ref()
918 if (!head_ref) { in btrfs_add_delayed_tree_ref()
930 kmem_cache_free(btrfs_delayed_ref_head_cachep, head_ref); in btrfs_add_delayed_tree_ref()
946 init_delayed_ref_head(head_ref, record, bytenr, num_bytes, in btrfs_add_delayed_tree_ref()
949 head_ref->extent_op = extent_op; in btrfs_add_delayed_tree_ref()
958 head_ref = add_delayed_ref_head(trans, head_ref, record, in btrfs_add_delayed_tree_ref()
961 ret = insert_delayed_ref(trans, delayed_refs, head_ref, &ref->node); in btrfs_add_delayed_tree_ref()
991 struct btrfs_delayed_ref_head *head_ref; in btrfs_add_delayed_data_ref() local
1022 head_ref = kmem_cache_alloc(btrfs_delayed_ref_head_cachep, GFP_NOFS); in btrfs_add_delayed_data_ref()
1023 if (!head_ref) { in btrfs_add_delayed_data_ref()
1036 head_ref); in btrfs_add_delayed_data_ref()
1041 init_delayed_ref_head(head_ref, record, bytenr, num_bytes, ref_root, in btrfs_add_delayed_data_ref()
1043 head_ref->extent_op = NULL; in btrfs_add_delayed_data_ref()
1052 head_ref = add_delayed_ref_head(trans, head_ref, record, in btrfs_add_delayed_data_ref()
1055 ret = insert_delayed_ref(trans, delayed_refs, head_ref, &ref->node); in btrfs_add_delayed_data_ref()
1080 struct btrfs_delayed_ref_head *head_ref; in btrfs_add_delayed_extent_op() local
1083 head_ref = kmem_cache_alloc(btrfs_delayed_ref_head_cachep, GFP_NOFS); in btrfs_add_delayed_extent_op()
1084 if (!head_ref) in btrfs_add_delayed_extent_op()
1087 init_delayed_ref_head(head_ref, NULL, bytenr, num_bytes, 0, 0, in btrfs_add_delayed_extent_op()
1090 head_ref->extent_op = extent_op; in btrfs_add_delayed_extent_op()
1095 add_delayed_ref_head(trans, head_ref, NULL, BTRFS_UPDATE_DELAYED_HEAD, in btrfs_add_delayed_extent_op()