aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorYushan Zhou <[email protected]>2023-01-03 05:11:37 +0000
committerDavid Sterba <[email protected]>2023-02-13 16:50:34 +0000
commitce394a7f39032bc2a85b070af608e3ae8b2cefda (patch)
tree9aad92997d8fb89919c8febb8cb482312648b207 /fs/btrfs/inode.c
parentbtrfs: go to matching label when cleaning em in btrfs_submit_direct (diff)
downloadkernel-ce394a7f39032bc2a85b070af608e3ae8b2cefda.tar.gz
kernel-ce394a7f39032bc2a85b070af608e3ae8b2cefda.zip
btrfs: use PAGE_{ALIGN, ALIGNED, ALIGN_DOWN} macro
The header file linux/mm.h provides PAGE_ALIGN, PAGE_ALIGNED, PAGE_ALIGN_DOWN macros. Use these macros to make code more concise. Signed-off-by: Yushan Zhou <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7fa1db6a474a..49a2e118f561 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -10995,9 +10995,8 @@ static int btrfs_add_swap_extent(struct swap_info_struct *sis,
return 0;
max_pages = sis->max - bsi->nr_pages;
- first_ppage = ALIGN(bsi->block_start, PAGE_SIZE) >> PAGE_SHIFT;
- next_ppage = ALIGN_DOWN(bsi->block_start + bsi->block_len,
- PAGE_SIZE) >> PAGE_SHIFT;
+ first_ppage = PAGE_ALIGN(bsi->block_start) >> PAGE_SHIFT;
+ next_ppage = PAGE_ALIGN_DOWN(bsi->block_start + bsi->block_len) >> PAGE_SHIFT;
if (first_ppage >= next_ppage)
return 0;