From: David Sterba Date: Tue, 8 Nov 2016 12:32:43 +0000 (+0100) Subject: btrfs: reada, cleanup remove unneeded variable in __readahead_hook X-Git-Tag: v4.14-rc1~1552^2~34^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04998b3324fc8aa8f0af9b820e865f8c9665120c;p=platform%2Fkernel%2Flinux-rpi3.git 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 --- diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index f7dd892..84a5beb 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);