提交 1280d2d1 编写于 作者: F Fanjun Kong 提交者: David Sterba

btrfs: use PAGE_ALIGNED instead of IS_ALIGNED

The <linux/mm.h> already provides the PAGE_ALIGNED macro. Let's
use it instead of IS_ALIGNED and passing PAGE_SIZE directly.
Reviewed-by: NMuchun Song <songmuchun@bytedance.com>
Reviewed-by: NNikolay Borisov <nborisov@suse.com>
Signed-off-by: NFanjun Kong <bh1scw@gmail.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 31f37269
...@@ -6206,7 +6206,7 @@ static int check_eb_alignment(struct btrfs_fs_info *fs_info, u64 start) ...@@ -6206,7 +6206,7 @@ static int check_eb_alignment(struct btrfs_fs_info *fs_info, u64 start)
return -EINVAL; return -EINVAL;
} }
if (fs_info->nodesize >= PAGE_SIZE && if (fs_info->nodesize >= PAGE_SIZE &&
!IS_ALIGNED(start, PAGE_SIZE)) { !PAGE_ALIGNED(start)) {
btrfs_err(fs_info, btrfs_err(fs_info,
"tree block is not page aligned, start %llu nodesize %u", "tree block is not page aligned, start %llu nodesize %u",
start, fs_info->nodesize); start, fs_info->nodesize);
......
...@@ -560,8 +560,8 @@ static inline int inode_need_compress(struct btrfs_inode *inode, u64 start, ...@@ -560,8 +560,8 @@ static inline int inode_need_compress(struct btrfs_inode *inode, u64 start,
* will unlock the full page. * will unlock the full page.
*/ */
if (fs_info->sectorsize < PAGE_SIZE) { if (fs_info->sectorsize < PAGE_SIZE) {
if (!IS_ALIGNED(start, PAGE_SIZE) || if (!PAGE_ALIGNED(start) ||
!IS_ALIGNED(end + 1, PAGE_SIZE)) !PAGE_ALIGNED(end + 1))
return 0; return 0;
} }
...@@ -678,8 +678,8 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) ...@@ -678,8 +678,8 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
* Thus we must also check against @actual_end, not just @end. * Thus we must also check against @actual_end, not just @end.
*/ */
if (blocksize < PAGE_SIZE) { if (blocksize < PAGE_SIZE) {
if (!IS_ALIGNED(start, PAGE_SIZE) || if (!PAGE_ALIGNED(start) ||
!IS_ALIGNED(round_up(actual_end, blocksize), PAGE_SIZE)) !PAGE_ALIGNED(round_up(actual_end, blocksize)))
goto cleanup_and_bail_uncompressed; goto cleanup_and_bail_uncompressed;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册