summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/orphan.c
diff options
context:
space:
mode:
authorKelley Nielsen <kelleynnn@gmail.com>2013-11-04 19:37:39 -0800
committerChris Mason <clm@fb.com>2014-01-28 13:19:37 -0800
commit3f870c28990015a1fd6c67807efcdb02a75b35e1 (patch)
treea2fae72984da0afed204b60a93df48b0de596c7f /fs/btrfs/orphan.c
parent75ac2dd907013b44edbdec16f8969d14811149c9 (diff)
downloadlinux-3f870c28990015a1fd6c67807efcdb02a75b35e1.tar.gz
linux-3f870c28990015a1fd6c67807efcdb02a75b35e1.tar.bz2
linux-3f870c28990015a1fd6c67807efcdb02a75b35e1.zip
btrfs: expand btrfs_find_item() to include find_orphan_item functionality
This is the third step in bootstrapping the btrfs_find_item interface. The function find_orphan_item(), in orphan.c, is similar to the two functions already replaced by the new interface. It uses two parameters, which are already present in the interface, and is nearly identical to the function brought in in the previous patch. Replace the two calls to find_orphan_item() with calls to btrfs_find_item(), with the defined objectid and type that was used internally by find_orphan_item(), a null path, and a null key. Add a test for a null path to btrfs_find_item, and if it passes, allocate and free the path. Finally, remove find_orphan_item(). Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/orphan.c')
-rw-r--r--fs/btrfs/orphan.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/fs/btrfs/orphan.c b/fs/btrfs/orphan.c
index 24cad1695af7..65793edb38ca 100644
--- a/fs/btrfs/orphan.c
+++ b/fs/btrfs/orphan.c
@@ -69,23 +69,3 @@ out:
btrfs_free_path(path);
return ret;
}
-
-int btrfs_find_orphan_item(struct btrfs_root *root, u64 offset)
-{
- struct btrfs_path *path;
- struct btrfs_key key;
- int ret;
-
- key.objectid = BTRFS_ORPHAN_OBJECTID;
- key.type = BTRFS_ORPHAN_ITEM_KEY;
- key.offset = offset;
-
- path = btrfs_alloc_path();
- if (!path)
- return -ENOMEM;
-
- ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
-
- btrfs_free_path(path);
- return ret;
-}