summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLiu Bo <bo.liu@linux.alibaba.com>2018-08-17 05:05:28 +0800
committerDavid Sterba <dsterba@suse.com>2018-10-15 17:23:27 +0200
commitbee6ec822a6a686d1b8ac65298b07765a48aefad (patch)
tree4f260eb96faf5365c0143b76093c6031737af25f /fs
parent9c7b0c2e8dbfbcd80a71e2cbfe02704f26c185c6 (diff)
downloadlinux-bee6ec822a6a686d1b8ac65298b07765a48aefad.tar.gz
linux-bee6ec822a6a686d1b8ac65298b07765a48aefad.tar.bz2
linux-bee6ec822a6a686d1b8ac65298b07765a48aefad.zip
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 <bo.liu@linux.alibaba.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2a8d4d36335e..97ccc774f13d 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;