diff options
author | Johannes Thumshirn <jthumshirn@suse.de> | 2018-12-05 17:23:03 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-12-17 16:51:45 +0300 |
commit | 7073017aeb98db311ca407f0f552f2bfc1af3015 (patch) | |
tree | 55437b78aa398fc0b50224e6cd5af3e35dce0e5d /fs/btrfs/compression.c | |
parent | cb5583dd52fab469a001a007385066fcd60629c5 (diff) | |
download | linux-7073017aeb98db311ca407f0f552f2bfc1af3015.tar.xz |
btrfs: use offset_in_page instead of open-coding it
Constructs like 'var & (PAGE_SIZE - 1)' or 'var & ~PAGE_MASK' can denote an
offset into a page.
So replace them by the offset_in_page() macro instead of open-coding it if
they're not used as an alignment check.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index dba59ae914b8..2ab5591449f2 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -477,7 +477,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, if (page->index == end_index) { char *userpage; - size_t zero_offset = isize & (PAGE_SIZE - 1); + size_t zero_offset = offset_in_page(isize); if (zero_offset) { int zeros; |