From: Liu Bo Date: Thu, 16 Aug 2018 21:05:28 +0000 (+0800) Subject: Btrfs: remove always true if branch in btrfs_get_extent X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bee6ec822a6a686d1b8ac65298b07765a48aefad;p=linux.git Btrfs: remove always true if branch in btrfs_get_extent @path is always NULL when it comes to the if branch. Signed-off-by: Liu Bo Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2a8d4d36335ee..97ccc774f13d8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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;