Message ID | 20181127160010.18123-3-jthumshirn@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Misc cosmetic changes for map_private_extent_buffer | expand |
On 27.11.18 г. 18:00 ч., Johannes Thumshirn wrote: > 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; >
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;
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> --- fs/btrfs/extent_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)