OSDN Git Service

btrfs: expand btrfs_find_item if found_key is NULL
[uclinux-h8/linux.git] / fs / btrfs / scrub.c
index 4846f66..53575a4 100644 (file)
@@ -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;