• Home
  • Raw
  • Download

Lines Matching refs:head

158 			   struct btrfs_delayed_ref_head *head)  in btrfs_delayed_ref_lock()  argument
164 if (mutex_trylock(&head->mutex)) in btrfs_delayed_ref_lock()
167 atomic_inc(&head->node.refs); in btrfs_delayed_ref_lock()
170 mutex_lock(&head->mutex); in btrfs_delayed_ref_lock()
172 if (!head->node.in_tree) { in btrfs_delayed_ref_lock()
173 mutex_unlock(&head->mutex); in btrfs_delayed_ref_lock()
174 btrfs_put_delayed_ref(&head->node); in btrfs_delayed_ref_lock()
177 btrfs_put_delayed_ref(&head->node); in btrfs_delayed_ref_lock()
183 struct btrfs_delayed_ref_head *head, in drop_delayed_ref() argument
187 head = btrfs_delayed_node_to_head(ref); in drop_delayed_ref()
188 rb_erase(&head->href_node, &delayed_refs->href_root); in drop_delayed_ref()
190 assert_spin_locked(&head->lock); in drop_delayed_ref()
200 struct btrfs_delayed_ref_head *head, in merge_ref() argument
207 next = list_first_entry(&head->ref_list, struct btrfs_delayed_ref_node, in merge_ref()
209 while (!done && &next->list != &head->ref_list) { in merge_ref()
246 drop_delayed_ref(trans, delayed_refs, head, next); in merge_ref()
249 drop_delayed_ref(trans, delayed_refs, head, ref); in merge_ref()
268 struct btrfs_delayed_ref_head *head) in btrfs_merge_delayed_refs() argument
273 assert_spin_locked(&head->lock); in btrfs_merge_delayed_refs()
275 if (list_empty(&head->ref_list)) in btrfs_merge_delayed_refs()
279 if (head->is_data) in btrfs_merge_delayed_refs()
292 ref = list_first_entry(&head->ref_list, struct btrfs_delayed_ref_node, in btrfs_merge_delayed_refs()
294 while (&ref->list != &head->ref_list) { in btrfs_merge_delayed_refs()
298 if (merge_ref(trans, delayed_refs, head, ref, seq)) { in btrfs_merge_delayed_refs()
299 if (list_empty(&head->ref_list)) in btrfs_merge_delayed_refs()
301 ref = list_first_entry(&head->ref_list, in btrfs_merge_delayed_refs()
339 struct btrfs_delayed_ref_head *head; in btrfs_select_ref_head() local
347 head = find_ref_head(&delayed_refs->href_root, start, 1); in btrfs_select_ref_head()
348 if (!head && !loop) { in btrfs_select_ref_head()
352 head = find_ref_head(&delayed_refs->href_root, start, 1); in btrfs_select_ref_head()
353 if (!head) in btrfs_select_ref_head()
355 } else if (!head && loop) { in btrfs_select_ref_head()
359 while (head->processing) { in btrfs_select_ref_head()
362 node = rb_next(&head->href_node); in btrfs_select_ref_head()
371 head = rb_entry(node, struct btrfs_delayed_ref_head, in btrfs_select_ref_head()
375 head->processing = 1; in btrfs_select_ref_head()
378 delayed_refs->run_delayed_start = head->node.bytenr + in btrfs_select_ref_head()
379 head->node.num_bytes; in btrfs_select_ref_head()
380 return head; in btrfs_select_ref_head()