btrfs: don't initialize 'offset' in map_private_extent_buffer()
authorJohannes Thumshirn <jthumshirn@suse.de>
Wed, 28 Nov 2018 08:54:54 +0000 (09:54 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:41 +0000 (14:51 +0100)
In map_private_extent_buffer() the 'offset' variable is initialized to a
page aligned version of the 'start' parameter.

But later on it is overwritten with either the offset from the extent
buffer's start or 0.

So get rid of the initial initialization.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index 582b4b1c41e08a33554dd618ec94a823d70698d3..7aafdec49dc3ada209a1a3c2355a1b6512817cd2 100644 (file)
@@ -5380,7 +5380,7 @@ int map_private_extent_buffer(const struct extent_buffer *eb,
                              char **map, unsigned long *map_start,
                              unsigned long *map_len)
 {
-       size_t offset = start & (PAGE_SIZE - 1);
+       size_t offset;
        char *kaddr;
        struct page *p;
        size_t start_offset = eb->start & ((u64)PAGE_SIZE - 1);