Commit 04998b33 authored by David Sterba's avatar David Sterba
Browse files

btrfs: reada, cleanup remove unneeded variable in __readahead_hook



We can't touch the eb directly in case the function is called with a
non-zero error, so we can read the eb level when needed.

Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent ef2fff64
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -109,16 +109,12 @@ static void __readahead_hook(struct btrfs_fs_info *fs_info,
			     struct reada_extent *re, struct extent_buffer *eb,
			     struct reada_extent *re, struct extent_buffer *eb,
			     u64 start, int err)
			     u64 start, int err)
{
{
	int level = 0;
	int nritems;
	int nritems;
	int i;
	int i;
	u64 bytenr;
	u64 bytenr;
	u64 generation;
	u64 generation;
	struct list_head list;
	struct list_head list;


	if (eb)
		level = btrfs_header_level(eb);

	spin_lock(&re->lock);
	spin_lock(&re->lock);
	/*
	/*
	 * just take the full list from the extent. afterwards we
	 * just take the full list from the extent. afterwards we
@@ -143,7 +139,7 @@ static void __readahead_hook(struct btrfs_fs_info *fs_info,
	 * trigger more readahead depending from the content, e.g.
	 * trigger more readahead depending from the content, e.g.
	 * fetch the checksums for the extents in the leaf.
	 * fetch the checksums for the extents in the leaf.
	 */
	 */
	if (!level)
	if (!btrfs_header_level(eb))
		goto cleanup;
		goto cleanup;


	nritems = btrfs_header_nritems(eb);
	nritems = btrfs_header_nritems(eb);