All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: David Sterba <dsterba@suse.com>
Cc: Linux BTRFS Mailinglist <linux-btrfs@vger.kernel.org>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH v2 2/3] btrfs: use offset_in_page for start_offset in map_private_extent_buffer()
Date: Wed, 28 Nov 2018 09:54:55 +0100	[thread overview]
Message-ID: <20181128085456.5702-3-jthumshirn@suse.de> (raw)
In-Reply-To: <20181128085456.5702-1-jthumshirn@suse.de>

In map_private_extent_buffer() use offset_in_page() to initialize
'start_offset' instead of open-coding it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
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 7aafdec49dc3..85cd3975c680 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5383,7 +5383,7 @@ int map_private_extent_buffer(const struct extent_buffer *eb,
 	size_t offset;
 	char *kaddr;
 	struct page *p;
-	size_t start_offset = eb->start & ((u64)PAGE_SIZE - 1);
+	size_t start_offset = offset_in_page(eb->start);
 	unsigned long i = (start_offset + start) >> PAGE_SHIFT;
 	unsigned long end_i = (start_offset + start + min_len - 1) >>
 		PAGE_SHIFT;
-- 
2.16.4


  parent reply	other threads:[~2018-11-28  8:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  8:54 [PATCH v2 0/3] Misc cosmetic changes for map_private_extent_buffer Johannes Thumshirn
2018-11-28  8:54 ` [PATCH v2 1/3] btrfs: don't initialize 'offset' in map_private_extent_buffer() Johannes Thumshirn
2018-11-28  8:54 ` Johannes Thumshirn [this message]
2018-11-28 15:41   ` [PATCH v2 2/3] btrfs: use offset_in_page for start_offset " David Sterba
2018-12-03 10:59     ` Johannes Thumshirn
2018-11-28  8:54 ` [PATCH v2 3/3] btrfs: document extent mapping assumptions in checksum Johannes Thumshirn
2018-11-28  8:58   ` Nikolay Borisov
2018-11-28 15:43 ` [PATCH v2 0/3] Misc cosmetic changes for map_private_extent_buffer David Sterba

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=20181128085456.5702-3-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=dsterba@suse.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.