Message ID | 20181128085456.5702-3-jthumshirn@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Misc cosmetic changes for map_private_extent_buffer | expand |
On Wed, Nov 28, 2018 at 09:54:55AM +0100, Johannes Thumshirn wrote: > In map_private_extent_buffer() use offset_in_page() to initialize > 'start_offset' instead of open-coding it. Can you please fix all instances where it's opencoded? Grepping for 'PAGE_SIZE - 1' finds a number of them. Thanks.
On 28/11/2018 16:41, David Sterba wrote: > On Wed, Nov 28, 2018 at 09:54:55AM +0100, Johannes Thumshirn wrote: >> In map_private_extent_buffer() use offset_in_page() to initialize >> 'start_offset' instead of open-coding it. > > Can you please fix all instances where it's opencoded? Grepping for > 'PAGE_SIZE - 1' finds a number of them. Thanks. Sure will do.
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;