浏览代码

btrfs: remove redundant check in btrfs_get_extent_fiemap

Before returning hole_em in btrfs_get_fiemap_extent we check if it's different
than null. However, by the time this null check is triggered we already know
hole_em is not null because it means it points to the em we found and it
has already been dereferenced.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Nikolay Borisov 7 年之前
父节点
当前提交
bf8d32b9b3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/btrfs/inode.c

+ 1 - 1
fs/btrfs/inode.c

@@ -7305,7 +7305,7 @@ struct extent_map *btrfs_get_extent_fiemap(struct btrfs_inode *inode,
 			em->block_start = EXTENT_MAP_DELALLOC;
 			em->block_start = EXTENT_MAP_DELALLOC;
 			em->block_len = found;
 			em->block_len = found;
 		}
 		}
-	} else if (hole_em) {
+	} else {
 		return hole_em;
 		return hole_em;
 	}
 	}
 out:
 out: