X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=fs%2Fbtrfs%2Froot-tree.c;h=dbe20d4c6ea4aba935d37b6a3fd283427661ffec;hb=ea9e8b11bd1252dcbc23afefcf1a52ec6aa3c113;hp=e9be3abcb368391dce1a78ccb8ede44431a03baa;hpb=0660b5af3f7ac0fac69de975914e1f4a3a586fb3;p=linux-2.6-block.git diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index e9be3abcb368..dbe20d4c6ea4 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c @@ -300,6 +300,22 @@ int btrfs_del_root_ref(struct btrfs_trans_handle *trans, return ret; } +int btrfs_find_root_ref(struct btrfs_root *tree_root, + struct btrfs_path *path, + u64 root_id, u64 ref_id) +{ + struct btrfs_key key; + int ret; + + key.objectid = root_id; + key.type = BTRFS_ROOT_REF_KEY; + key.offset = ref_id; + + ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); + return ret; +} + + /* * add a btrfs_root_ref item. type is either BTRFS_ROOT_REF_KEY * or BTRFS_ROOT_BACKREF_KEY.