summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
authorDavid Sterba2015-01-02 19:36:14 +0100
committerDavid Sterba2015-01-14 19:23:48 +0100
commit1d4c08e0a60be356134d0c466744d0d4e16ebab0 (patch)
tree99e3394eaf7542f187b1d70f7ec6d89b7d28fe1f /fs/btrfs/scrub.c
parentbtrfs: simplify insert_orphan_item (diff)
downloadkernel-qcow2-linux-1d4c08e0a60be356134d0c466744d0d4e16ebab0.tar.gz
kernel-qcow2-linux-1d4c08e0a60be356134d0c466744d0d4e16ebab0.tar.xz
kernel-qcow2-linux-1d4c08e0a60be356134d0c466744d0d4e16ebab0.zip
btrfs: expand btrfs_find_item if found_key is NULL
If the found_key is NULL, then btrfs_find_item becomes a verbose wrapper for simple btrfs_search_slot. After we've removed all such callers, passing a NULL key is not valid anymore. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 4846f66391a4..53575a45f7d1 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -520,6 +520,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root,
struct inode_fs_paths *ipath = NULL;
struct btrfs_root *local_root;
struct btrfs_key root_key;
+ struct btrfs_key key;
root_key.objectid = root;
root_key.type = BTRFS_ROOT_ITEM_KEY;
@@ -533,8 +534,11 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root,
/*
* this makes the path point to (inum INODE_ITEM ioff)
*/
- ret = btrfs_find_item(local_root, swarn->path, inum, 0,
- BTRFS_INODE_ITEM_KEY, NULL);
+ key.objectid = inum;
+ key.type = BTRFS_INODE_ITEM_KEY;
+ key.offset = 0;
+
+ ret = btrfs_search_slot(NULL, local_root, &key, swarn->path, 0, 0);
if (ret) {
btrfs_release_path(swarn->path);
goto err;