linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Johannes Thumshirn <jthumshirn@suse.de>, David Sterba <dsterba@suse.com>
Cc: Linux BTRFS Mailinglist <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/3] btrfs: don't initialize 'offset' in map_private_extent_buffer()
Date: Tue, 27 Nov 2018 18:31:11 +0200	[thread overview]
Message-ID: <53968133-ddfe-d402-e1f8-8a265dfa8cc3@suse.com> (raw)
In-Reply-To: <20181127160010.18123-2-jthumshirn@suse.de>



On 27.11.18 г. 18:00 ч., Johannes Thumshirn wrote:
> 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.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>

You know, the fastest/most clean code is the one which is deleted so :

Reviewed-by: Nikolay Borisov <nborisov@suse.com>


> ---
>  fs/btrfs/extent_io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 582b4b1c41e0..7aafdec49dc3 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -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);
> 

  reply	other threads:[~2018-11-27 16:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 16:00 [PATCH 0/3] Misc cosmetic changes for map_private_extent_buffer Johannes Thumshirn
2018-11-27 16:00 ` [PATCH 1/3] btrfs: don't initialize 'offset' in map_private_extent_buffer() Johannes Thumshirn
2018-11-27 16:31   ` Nikolay Borisov [this message]
2018-11-27 16:00 ` [PATCH 2/3] btrfs: use offset_in_page for start_offset " Johannes Thumshirn
2018-11-27 16:33   ` Nikolay Borisov
2018-11-27 16:00 ` [PATCH 3/3] btrfs: document extent mapping assumptions in checksum Johannes Thumshirn
2018-11-27 16:36   ` Nikolay Borisov
2018-11-27 19:08     ` Noah Massey
2018-11-27 19:32       ` Nikolay Borisov
2018-11-27 20:20         ` Noah Massey
2018-11-28  8:39     ` Johannes Thumshirn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53968133-ddfe-d402-e1f8-8a265dfa8cc3@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).