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/ctree.c | |
parent | 9c4f61f01d269815bb7c37be3ede59c5587747c6 (diff) |
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/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index f54511dd287e..20d1f2b0403d 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2618,13 +2618,14 @@ int btrfs_find_item(struct btrfs_root *fs_root, struct btrfs_path *path, struct extent_buffer *eb; ASSERT(path); + ASSERT(found_key); key.type = key_type; key.objectid = iobjectid; key.offset = ioff; ret = btrfs_search_slot(NULL, fs_root, &key, path, 0, 0); - if ((ret < 0) || (found_key == NULL)) + if (ret < 0) return ret; eb = path->nodes[0]; |