diff options
author | David Sterba <dsterba@suse.cz> | 2015-01-02 19:36:14 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-01-14 19:23:48 +0100 |
commit | 1d4c08e0a60be356134d0c466744d0d4e16ebab0 (patch) | |
tree | 99e3394eaf7542f187b1d70f7ec6d89b7d28fe1f /fs/btrfs/scrub.c | |
parent | 9c4f61f01d269815bb7c37be3ede59c5587747c6 (diff) | |
download | op-kernel-dev-1d4c08e0a60be356134d0c466744d0d4e16ebab0.zip op-kernel-dev-1d4c08e0a60be356134d0c466744d0d4e16ebab0.tar.gz |
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.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 4846f66..53575a4 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; |