aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/delayed-ref.c')
-rw-r--r--fs/btrfs/delayed-ref.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 874565a1f634..3e7eeaf86408 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -511,6 +511,24 @@ int btrfs_add_delayed_ref(struct btrfs_trans_handle *trans,
511} 511}
512 512
513/* 513/*
514 * this does a simple search for the head node for a given extent.
515 * It must be called with the delayed ref spinlock held, and it returns
516 * the head node if any where found, or NULL if not.
517 */
518struct btrfs_delayed_ref_head *
519btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr)
520{
521 struct btrfs_delayed_ref_node *ref;
522 struct btrfs_delayed_ref_root *delayed_refs;
523
524 delayed_refs = &trans->transaction->delayed_refs;
525 ref = tree_search(&delayed_refs->root, bytenr, (u64)-1);
526 if (ref)
527 return btrfs_delayed_node_to_head(ref);
528 return NULL;
529}
530
531/*
514 * add a delayed ref to the tree. This does all of the accounting required 532 * add a delayed ref to the tree. This does all of the accounting required
515 * to make sure the delayed ref is eventually processed before this 533 * to make sure the delayed ref is eventually processed before this
516 * transaction commits. 534 * transaction commits.