summaryrefslogtreecommitdiff
path: root/fs/btrfs/reada.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-11-08 15:32:43 +0300
committerDavid Sterba <dsterba@suse.com>2016-11-30 15:45:15 +0300
commit04998b3324fc8aa8f0af9b820e865f8c9665120c (patch)
tree9bcd85e8eb873bcbb27288e5e3601d9351162772 /fs/btrfs/reada.c
parentef2fff64fd541af1e23eeae48d6ffdfcd92ae2a3 (diff)
downloadlinux-04998b3324fc8aa8f0af9b820e865f8c9665120c.tar.xz
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: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/reada.c')
-rw-r--r--fs/btrfs/reada.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
index f7dd892669a5..84a5beb48d46 100644
--- a/fs/btrfs/reada.c
+++ b/fs/btrfs/reada.c
@@ -109,16 +109,12 @@ static void __readahead_hook(struct btrfs_fs_info *fs_info,
struct reada_extent *re, struct extent_buffer *eb,
u64 start, int err)
{
- int level = 0;
int nritems;
int i;
u64 bytenr;
u64 generation;
struct list_head list;
- if (eb)
- level = btrfs_header_level(eb);
-
spin_lock(&re->lock);
/*
* 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.
* fetch the checksums for the extents in the leaf.
*/
- if (!level)
+ if (!btrfs_header_level(eb))
goto cleanup;
nritems = btrfs_header_nritems(eb);