Lines Matching refs:head

72  * btrfs_delayed_refs_rsv_release - release a ref head's reservation.
76 * This drops the delayed ref head's count from the delayed refs rsv and frees
276 /* insert a new ref to head ref rbtree */
356 * Find a head entry based on bytenr. This returns the delayed ref head if it
394 struct btrfs_delayed_ref_head *head)
397 if (mutex_trylock(&head->mutex))
400 refcount_inc(&head->refs);
403 mutex_lock(&head->mutex);
405 if (RB_EMPTY_NODE(&head->href_node)) {
406 mutex_unlock(&head->mutex);
407 btrfs_put_delayed_ref_head(head);
410 btrfs_put_delayed_ref_head(head);
416 struct btrfs_delayed_ref_head *head,
419 lockdep_assert_held(&head->lock);
420 rb_erase_cached(&ref->ref_node, &head->ref_tree);
431 struct btrfs_delayed_ref_head *head,
459 drop_delayed_ref(trans, delayed_refs, head, next);
462 drop_delayed_ref(trans, delayed_refs, head, ref);
478 struct btrfs_delayed_ref_head *head)
485 lockdep_assert_held(&head->lock);
487 if (RB_EMPTY_ROOT(&head->ref_tree.rb_root))
491 if (head->is_data)
505 for (node = rb_first_cached(&head->ref_tree); node;
510 if (merge_ref(trans, delayed_refs, head, ref, seq))
540 struct btrfs_delayed_ref_head *head;
543 head = find_ref_head(delayed_refs, delayed_refs->run_delayed_start,
545 if (!head && delayed_refs->run_delayed_start != 0) {
547 head = find_first_ref_head(delayed_refs);
549 if (!head)
552 while (head->processing) {
555 node = rb_next(&head->href_node);
562 head = rb_entry(node, struct btrfs_delayed_ref_head,
566 head->processing = 1;
569 delayed_refs->run_delayed_start = head->bytenr +
570 head->num_bytes;
571 return head;
575 struct btrfs_delayed_ref_head *head)
578 lockdep_assert_held(&head->lock);
580 rb_erase_cached(&head->href_node, &delayed_refs->href_root);
581 RB_CLEAR_NODE(&head->href_node);
584 if (head->processing == 0)
646 * helper function to update the accounting in the head ref
666 * with an existing head ref without
699 * update the reference mod on the head to reflect this new operation,
762 * The head node stores the sum of all the mods, so dropping a ref
763 * should drop the sum in the head node by one.
812 * helper function to actually insert a head node into the rbtree.
993 * insert both the head node and the new ref without dropping
1087 * insert both the head node and the new ref without dropping
1147 * This does a simple search for the head node for a given extent. Returns the
1148 * head node if found, or NULL if not.