Skip to content

Commit

Permalink
Btrfs: remove always true if branch in btrfs_get_extent
Browse files Browse the repository at this point in the history
@path is always NULL when it comes to the if branch.

Signed-off-by: Liu Bo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
liubogithub authored and kdave committed Oct 15, 2018
1 parent 9c7b0c2 commit bee6ec8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -6821,19 +6821,15 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
em->len = (u64)-1;
em->block_len = (u64)-1;

path = btrfs_alloc_path();
if (!path) {
path = btrfs_alloc_path();
if (!path) {
err = -ENOMEM;
goto out;
}
/*
* Chances are we'll be called again, so go ahead and do
* readahead
*/
path->reada = READA_FORWARD;
err = -ENOMEM;
goto out;
}

/* Chances are we'll be called again, so go ahead and do readahead */
path->reada = READA_FORWARD;

ret = btrfs_lookup_file_extent(NULL, root, path, objectid, start, 0);
if (ret < 0) {
err = ret;
Expand Down

0 comments on commit bee6ec8

Please sign in to comment.