diff options
author | Heinrich Schuchardt | 2022-05-10 21:43:38 +0200 |
---|---|---|
committer | Tom Rini | 2022-06-06 17:47:17 -0400 |
commit | 89ab1e28173b7b23504ecd39e618fc73bbfd0371 (patch) | |
tree | 298d9d3ede38aa6b1bb6199ba7e7a685aae78c7c /fs | |
parent | 2e2e784de0605081af7c5c9d04a014af69888c2c (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d00b5153336..0173d30cd8a 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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 || |