mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
btrfs: simplify lookup_data_extent()
After returning if ret <= 0 we know that ret > 0. No need to check it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Anand Jain <anand.jain>
This commit is contained in:
parent
2e2e784de0
commit
89ab1e2817
1 changed files with 6 additions and 9 deletions
|
@ -546,15 +546,12 @@ static int lookup_data_extent(struct btrfs_root *root, struct btrfs_path *path,
|
|||
/* Error or we're already at the file extent */
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
if (ret > 0) {
|
||||
/* Check previous file extent */
|
||||
ret = btrfs_previous_item(root, path, ino,
|
||||
BTRFS_EXTENT_DATA_KEY);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
goto check_next;
|
||||
}
|
||||
/* Check previous file extent */
|
||||
ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
goto check_next;
|
||||
/* Now the key.offset must be smaller than @file_offset */
|
||||
btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
|
||||
if (key.objectid != ino ||
|
||||
|
|
Loading…
Reference in a new issue